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.006850936
Marked as misclassified No
Message-id <1228499730.65.0.607233400462.issue826897@psf.upfronthosting.co.za>
In-reply-to
Content
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):
    try:
      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):
    pass

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.
History
Date User Action Args
2008-12-05 17:55:30terry.reedysetrecipients: + terry.reedy, tim.peters, akuchling
2008-12-05 17:55:30terry.reedysetmessageid: <1228499730.65.0.607233400462.issue826897@psf.upfronthosting.co.za>
2008-12-05 17:55:27terry.reedylinkissue826897 messages
2008-12-05 17:55:26terry.reedycreate