Message170070
| Author |
Albert.Zeyer |
| Recipients |
Albert.Zeyer |
| Date |
2012年09月09日.00:14:55 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1347149709.6.0.110064908732.issue15885@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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'. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月09日 00:15:39 | Albert.Zeyer | set | recipients:
+ Albert.Zeyer |
| 2012年09月09日 00:15:09 | Albert.Zeyer | set | messageid: <1347149709.6.0.110064908732.issue15885@psf.upfronthosting.co.za> |
| 2012年09月09日 00:15:07 | Albert.Zeyer | link | issue15885 messages |
| 2012年09月09日 00:14:55 | Albert.Zeyer | create |
|