[issue15885] @staticmethod __getattr__ doesn't work

2012-09-09 Thread Albert Zeyer
Albert Zeyer added the comment: I don't quite understand. Shouldn't __getattr__ also work in old-style classes? And the error itself ('staticmethod' object is not callable), shouldn't that be impossible? -- ___ Python tracker

[issue15885] @staticmethod __getattr__ doesn't work

2012-09-08 Thread Eric Snow
Eric Snow added the comment: In Python 2 the code example generates an old-style class. When I tried it with a new style class, it worked fine: class Wrapper(object): @staticmethod def __getattr__(item): return repr(item) # dummy a = Wrapper() print(a.foo) # 'f

[issue15885] @staticmethod __getattr__ doesn't work

2012-09-08 Thread Albert Zeyer
New submission from Albert Zeyer: Code: ``` class Wrapper: @staticmethod def __getattr__(item): return repr(item) # dummy a = Wrapper() print(a.foo) ``` Expected output: 'foo' Actual output with Python 2.7: Traceback (most recent call last): File "test_stati