Re: Subclassing dict to modify values

2017-08-02 Thread Matt Wheeler
On Wed, 2 Aug 2017 at 23:26 Ian Pilcher wrote: > YANQ (Yet Another Newbie Question) ... > > I would like to create a subclass of dict that modifies values as they > are inserted. (Effectively I want to do the equivalent of "interning" > the values, although they aren't strings.) > > Do I need to

Subclassing dict to modify values

2017-08-02 Thread Ian Pilcher
YANQ (Yet Another Newbie Question) ... I would like to create a subclass of dict that modifies values as they are inserted. (Effectively I want to do the equivalent of "interning" the values, although they aren't strings.) Do I need to implement any methods other than __setitem__? (I.e. will a