Instances' __setitem__ methods

Ethan Furman ethan at stoneleaf.us
Mon Jun 20 23:37:34 EDT 2011


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 instance.

~Ethan~



More information about the Python-list mailing list