Message290481
Doing a copy on a staticmethod breaks it:
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from copy import copy
>>> def foo(): pass
...
>>> class bar: pass
...
>>> bar.x = staticmethod(foo)
>>> bar.x.__name__
'foo'
>>> bar.y = copy(staticmethod(foo))
>>> bar.y.__name__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: uninitialized staticmethod object |
|
Date |
User |
Action |
Args |
2017-03-25 13:16:44 | dangyogi | set | recipients:
+ dangyogi |
2017-03-25 13:16:44 | dangyogi | set | messageid: <1490447804.79.0.661284691694.issue29902@psf.upfronthosting.co.za> |
2017-03-25 13:16:44 | dangyogi | link | issue29902 messages |
2017-03-25 13:16:44 | dangyogi | create | |
|