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 terry.reedy
Recipients akuchling, terry.reedy, tim.peters
Date 2008-12-05.17:55:26
SpamBayes Score 0.00685094
Marked as misclassified No
Message-id <>
James Stroud ran into this same issue with 2.5.  Here is his 'ugly fix'
for working with protocol 2 only.

class DictPlus(dict):
  def __init__(self, *args, **kwargs):
    self.extra_thing = ExtraThingClass()
    dict.__init__(self, *args, **kwargs)
  def __setitem__(self, k, v):
      do_something_with(self.extra_thing, k, v)
    except AttributeError:
      self.extra_thing = ExtraThingClass()
      do_something_with(self.extra_thing, k, v)
    dict.__setitem__(self, k, v)
  def __setstate__(self, adict):

Can this be closed as "won't fix", since there seems nothing to fix?
This issue of working with all protocols would seem dead by now, and for
protocol 2, it is a 'gotcha' that can be avoided with knowledge.
Date User Action Args
2008-12-05 17:55:30terry.reedysetrecipients: + terry.reedy, tim.peters, akuchling
2008-12-05 17:55:30terry.reedysetmessageid: <>
2008-12-05 17:55:27terry.reedylinkissue826897 messages
2008-12-05 17:55:26terry.reedycreate