Overriding iadd for dictionary like objects

Robert Kern robert.kern at gmail.com
Thu Aug 27 18:16:41 CEST 2009

On 2009-08-27 01:49 AM, RunThePun wrote:

> Anybody have any more ideas? I think python should/could havev a
> syntax for overriding this behaviour, i mean, obviously the complexity
> of supporting all operators with the getitem syntax could introduce
> alot of clutter. But maybe there's an elegant solution out there...

I would recommend just adding a method to MyDict that does exactly what you want.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-list mailing list