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 louielu
Recipients louielu, serhiy.storchaka, terry.reedy, yselivanov
Date 2017-05-04.14:57:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thing just getting weird. If we remove the guard, some of the builtin function will get not-so-good signature result:

>>> i.signature(range.__init__)
<Signature (self, /, *args, **kwargs)>
>>> i.signature(list.append)                                                                                          
<Signature (self, object, /)>
>>> i.signature([].append)                                                                                            
<Signature (object, /)>

You can check my latest commit, The most big change is about __method__, it will make some different behavior:

str(i.signature(list.__new__)) -> (*args, **kwargs)
str(i.signature(p.sub))        -> (repl, string, count=0)

both of them are BuiltinFunctionType, and the first one in old version will be guard, so the get_argspec result will be docstring, we can't different them in non-guard version.
Date User Action Args
2017-05-04 14:57:19louielusetrecipients: + louielu, terry.reedy, serhiy.storchaka, yselivanov
2017-05-04 14:57:19louielusetmessageid: <>
2017-05-04 14:57:19louielulinkissue19903 messages
2017-05-04 14:57:19louielucreate