2007-01-08 | paulb | file changeset files shortlog | Added an exception to the locally defined function names rule: within a class definition, methods should not be accessible via their plain names alone (ie. like functions). |
paulb@168 | 1 | class A: |
paulb@168 | 2 | pass |
paulb@168 | 3 | |
paulb@168 | 4 | def f(x): |
paulb@168 | 5 | try: |
paulb@168 | 6 | try: |
paulb@168 | 7 | y = x.attr |
paulb@168 | 8 | except AttributeError, e: |
paulb@168 | 9 | f = e |
paulb@168 | 10 | except Exception, e: |
paulb@168 | 11 | f = e |
paulb@168 | 12 | return f |
paulb@168 | 13 | |
paulb@168 | 14 | x = A() |
paulb@168 | 15 | f(x) |