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 <1493909839.64.0.162539081292.issue19903@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-05-04 14:57:19louielusetrecipients: + louielu, terry.reedy, serhiy.storchaka, yselivanov
2017-05-04 14:57:19louielusetmessageid: <1493909839.64.0.162539081292.issue19903@psf.upfronthosting.co.za>
2017-05-04 14:57:19louielulinkissue19903 messages
2017-05-04 14:57:19louielucreate