This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients casevh, josh.r, lemburg, mark.dickinson, pitrou, rhettinger, serhiy.storchaka, vstinner, yselivanov, zbyrne
Date 2016-02-04.14:01:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454594499.1.0.150189545222.issue21955@psf.upfronthosting.co.za>
In-reply-to
Content
> Why not combine my patch and Serhiy's?  First we check if left & right are both longs.  Then we check if they are unicode (for +).  And then we have a fastpath for floats.

See my comment on Serhiy's patch. Maybe we can start by check that the type of both operands are the same, and then use PyLong_CheckExact and PyUnicode_CheckExact.

Using such design, we may add a _PyFloat_Add(). But the next question is then the overhead on the "slow" path, which requires a benchmark too! For example, use a subtype of int.
History
Date User Action Args
2016-02-04 14:01:39vstinnersetrecipients: + vstinner, lemburg, rhettinger, mark.dickinson, pitrou, casevh, serhiy.storchaka, yselivanov, josh.r, zbyrne
2016-02-04 14:01:39vstinnersetmessageid: <1454594499.1.0.150189545222.issue21955@psf.upfronthosting.co.za>
2016-02-04 14:01:39vstinnerlinkissue21955 messages
2016-02-04 14:01:38vstinnercreate