Re: Overriding iadd for dictionary like objects

2009-09-01 Thread RunThePun
On Sep 1, 3:00 am, a...@pythoncraft.com (Aahz) wrote: In article b11a8a0e-03ca-41c9-b0d0-c5180b6a2...@p15g2000vbl.googlegroups.com, RunThePun  ubershme...@gmail.com wrote: On Aug 30, 10:33=A0pm, a...@pythoncraft.com (Aahz) wrote: In article e09276e8-8152-4002-8366-4c12705a8

Re: Overriding iadd for dictionary like objects

2009-08-31 Thread RunThePun
On Aug 30, 10:33 pm, a...@pythoncraft.com (Aahz) wrote: In article e09276e8-8152-4002-8366-4c12705a8...@l35g2000vba.googlegroups.com, RunThePun  ubershme...@gmail.com wrote: I made a DictMixin where the keys are filenames and the values are the file contents. It was very simple

Re: Overriding iadd for dictionary like objects

2009-08-30 Thread RunThePun
/velocity one would be just: d = DirectoryDict(/root) d[tmp][velocity] = European or African So now I hope it's clearer why and how I wanted a special __item_iadd__ for the dictionary syntax, RunThePun -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding iadd for dictionary like objects

2009-08-27 Thread RunThePun
On Aug 27, 6:58 am, Robert Kern robert.k...@gmail.com wrote: On 2009-08-26 20:00 PM, Jan Kaliszewski wrote: 27-08-2009 o 00:48:33 Robert Kern robert.k...@gmail.com wrote: On 2009-08-26 17:16 PM, RunThePun wrote: I'd like to build a database wrapper using DictMixin and allow items

Overriding iadd for dictionary like objects

2009-08-26 Thread RunThePun
I'd like to build a database wrapper using DictMixin and allow items to be appended by my own code. The problem is += is always understood as setitem and getitem plainly. d = MyDict() d['a'] = 1 # this is the problem code that's I'd like to override. It's always setitem('a', getitem('a') + 3)