Re: Instances' __setitem__ methods

2011-06-20 Thread Chris Rebert
On Mon, Jun 20, 2011 at 6:42 PM, Spencer Pearson wrote: > I was recently trying to implement a dict-like object which would do > some fancy stuff when it was modified, and found that overriding the > __setitem__ method of an instance did not act the way I expected. The > help documentation (from h

Re: Instances' __setitem__ methods

2011-06-20 Thread Ethan Furman
Spencer Pearson wrote: I was recently trying to implement a dict-like object which would do some fancy stuff when it was modified, and found that overriding the __setitem__ method of an instance did not act the way I expected. The __magic__ methods are only looked up on the class, never the in

Instances' __setitem__ methods

2011-06-20 Thread Spencer Pearson
I was recently trying to implement a dict-like object which would do some fancy stuff when it was modified, and found that overriding the __setitem__ method of an instance did not act the way I expected. The help documentation (from help(dict.__setitem__)) claims that "d.__setitem__(k,v)" is equiva