Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

>From https://docs.python.org/3/library/pickle.html#pickling-class-instances:

    When a class instance is unpickled, its __init__() method is usually not 
invoked.

If you want to change this behavior you have to implement the __reduce__ or 
__reduce_ex__ methods or register the object type in the global or per-pickler 
dispatch table. For example:

class NocaseList(list):

    def __reduce__(self):
        return self.__class__, (), None, iter(self)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41639>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to