Serhiy Storchaka added the comment:

What are your thoughts Barry? staticmethod, classmethod and property objects 
are incorrectly pickled in 2.7 and 3.5 (they are not pickleable in 3.6+). 
Making them not pickleable in 2.7 and 3.5 can help to catch programming errors.

But this can break the code that "just works" (actually works incorrectly) if 
it pickles or deepcopies complex objects containing staticmethod, classmethod 
or property objects, but never use it. Similar situation happened in issue22995 
with Cython objects.

Maybe emitting a warning rather than an exception would be safer? But 
deprecation warnings are ignored by default.


Python tracker <>
Python-bugs-list mailing list

Reply via email to