Re: User class binary ops seem too slow (was re: GIL detector)

2014-08-18 Thread Steven D'Aprano
On Mon, 18 Aug 2014 00:43:58 -0400, Terry Reedy wrote: > >>> timeit.repeat('1+1') > [0.04067762117549266, 0.019206152658126363, 0.018796680446902643] I think you have been tripped up by the keyhole optimizer. I'm not entirely certain, but that's probably just measuring the overhead of evaluati

User class binary ops seem too slow (was re: GIL detector)

2014-08-17 Thread Terry Reedy
In a post about CPython's GIL, Steven D'Aprano pointed to Armin Ronacher's criticism of the internal type slots used for dunder methods. > http://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-to-see/ I found the following interesting. " Since we have an __add__ method the interpreter will