On Mon, 11 Aug 2014 21:43:00 +1000, Chris Angelico <ros...@gmail.com> wrote: > On Mon, Aug 11, 2014 at 9:40 PM, Peter Otten <__pete...@web.de> wrote: > > Read again. The OP tries to delegate attribute lookup to an (existing) > > attribute. > > > > IMO the root cause of the problem is that pickle looks up __dunder__ methods > > in the instance rather than the class. > > The recursion comes from the attempted lookup of self.item, when > __init__ hasn't been called.
Indeed, and this is what the OP missed. With a class like this, it is necessary to *make* it pickleable, since the pickle protocol doesn't call __init__. --David _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com