[Python-ideas] Including elementary mathematical functions in the python data model

Nick Coghlan ncoghlan at gmail.com
Mon Sep 27 14:20:14 CEST 2010

On Mon, Sep 27, 2010 at 8:29 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Nick Coghlan wrote:
>> Couple that with the extra function call overhead (since these
>> wouldn't have real typeslots) and it still seems like a less than
>> stellar idea.
>> As another use case for solid, efficient generic function support
>> though... great idea :)
> Could a generic function mechanism be made to have any
> less overhead, though?

See my response to Antoine - probably not. Although, as has been
pointed out by others, by doing the check for PyFloat_CheckExact early
and running the fast path immediately if that check passes, you can
avoid most of the overhead in the common case, even when using
pseudo-typeslots. So performance impact likely isn't a major factor
here after all.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list