Louie Lu added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19903>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to