Re: PEP: add __sum__ method

2012-01-22 Thread Steven D'Aprano
On Sun, 22 Jan 2012 03:15:48 -0800, dmitrey wrote: > hi all, > could you consider adding __sum__ method, e.g. Python sum(a) checks does > a have attribute __sum__ and if it has, then a.__sum__() is invoked > instead of Python sum(a). > (for my soft FuncDesigner it would be very essential, I guess

PEP: add __sum__ method

2012-01-22 Thread dmitrey
hi all, could you consider adding __sum__ method, e.g. Python sum(a) checks does a have attribute __sum__ and if it has, then a.__sum__() is invoked instead of Python sum(a). (for my soft FuncDesigner it would be very essential, I guess for many other soft as well, e.g. for PuLP, who has to use lpS