This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients andymaier, pitrou, serhiy.storchaka
Date 2020-08-26.11:02:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598439760.96.0.455795267871.issue41639@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2020-08-26 11:02:41serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, andymaier
2020-08-26 11:02:40serhiy.storchakasetmessageid: <1598439760.96.0.455795267871.issue41639@roundup.psfhosted.org>
2020-08-26 11:02:40serhiy.storchakalinkissue41639 messages
2020-08-26 11:02:40serhiy.storchakacreate