[issue41547] Expose default __getstate__ and __setstate__

2020-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is virtually a duplicate of isssue26579. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Support pickling slots in subclasses of common classes

[issue41547] Expose default __getstate__ and __setstate__

2020-08-13 Thread youkaichao
New submission from youkaichao : According to the doc ( https://docs.python.org/3/library/pickle.html#object.__getstate__ ), an object may not have a __getstate__ method. During pickling and unpickling, python first finds __getstate__ and __setstate__, which may invoke a customed __getattr__.