Serhiy Storchaka added the comment:

Copying and pickling of staticmethod objects are not supported. Starting from 
3.6 this raises an exception (see issue22995).

>>> bar.y = copy(staticmethod(foo))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython3.6/Lib/", line 96, in copy
    rv = reductor(4)
TypeError: can't pickle staticmethod objects

components: +Interpreter Core
nosy: +alexandre.vassalotti, barry, serhiy.storchaka
versions: +Python 2.7

Python tracker <>
Python-bugs-list mailing list

Reply via email to