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 yselivanov
Recipients benjamin.peterson, eric.araujo, larry, ncoghlan, pitrou, python-dev, scoder, terry.reedy, yselivanov
Date 2014-02-01.18:39:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Would this be ok?

Probably. I need to take a closer look.

I'm not sure I like the idea that Cython functions are "chimeras" of some sort, i.e. they have a type of python builtin functions, hence, logically, Signature.from_builtin should work on them (and they have to follow __text_signature__ API), and on the other hand, they try to mimic pure python functions (being a builtin type) with all its guts like '__code__' object etc.  

Perhaps, what we need to do, is to modify 'Signature.from_builtin' to check for pure-python function duck type too, and fallback to 'Signature.from_function' in this case. Larry, Nick, what do you think?

> I would also argue that the implementation of _signature_is_builtin() is, well, not ideal, because what it should test for according to the comment at the top of the function is the existance of "__text_signature__". Instead, it does several type tests, one of which goes wrong in this case.

'from_builtin' needs to have those type checks. Duck typing is good, but some minimal type safety is good too.
Date User Action Args
2014-02-01 18:39:25yselivanovsetrecipients: + yselivanov, terry.reedy, ncoghlan, pitrou, scoder, larry, benjamin.peterson, eric.araujo, python-dev
2014-02-01 18:39:24yselivanovsetmessageid: <>
2014-02-01 18:39:24yselivanovlinkissue17159 messages
2014-02-01 18:39:24yselivanovcreate