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/copy.py", 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 <rep...@bugs.python.org> <http://bugs.python.org/issue29902> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com