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_staticmethodattr.py", line 7, in <module>
    print(a.foo)
TypeError: 'staticmethod' object is not callable

Python 3.2 does return the expected ('foo').
PyPy returns the expected 'foo'.

----------
components: Interpreter Core
messages: 170070
nosy: Albert.Zeyer
priority: normal
severity: normal
status: open
title: @staticmethod __getattr__ doesn't work
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15885>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to