[Python-ideas] Fast sum() for non-numbers - why so much worries?

Joshua Landau joshua at landau.ws
Wed Jul 10 23:27:49 CEST 2013


On 10 July 2013 22:03, Ethan Furman <ethan at stoneleaf.us> wrote:
> Make a patch and add it to the tracker.

Gah! Now I need to learn C... :P

> A word of warning/advice:  keep the __add__ fallback or it won't fly.
> __iadd__ is /optional/.  If the new sum() suddenly stops working on classes
> it worked fine with before, it will not be accepted.  Mind you, I haven't
> checked if PyNumber_InPlaceAdd will fall back to PyNumber_Add on its own.

It does.


More information about the Python-ideas mailing list