Author terry.reedy
Recipients louielu, serhiy.storchaka, terry.reedy, yselivanov
Date 2017-05-04.05:59:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493877579.77.0.150232153234.issue19903@psf.upfronthosting.co.za>
In-reply-to
Content
I pulled your pr, did some minor edits, committed, and tried to push back following this line from the devguide Bootcamp page.

git push git@github.com:<contributor>/cpython <pr_XXX>:<branch_name>
--------------

F:\dev\cpython>git commit -m "Fix and stop repeating invalid signature message"
[pr_1382 bb46c06645] Fix and stop repeating invalid signature message
 2 files changed, 6 insertions(+), 5 deletions(-)

F:\dev\cpython>git push git@github.com:lulouie/cpython pr_1382:pr_1382
The authenticity of host 'github.com (192.30.253.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
-------------

Did I do something wrong or do you need to allow me to push?
https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/
############################################################

There current PR is incomplete.  The main reason to switch to signature() is to get the signature of C-coded functions that have been converted to use Argument Clinic.  But...

>>> import re
>>> import inspect as i
>>> str(i.signature(i.signature))
'(obj, *, follow_wrapped=True)'
>>> str(i.signature(re.sub))
'(pattern, repl, string, count=0, flags=0)'
>>> p = re.compile('')
>>> str(i.signature(p.sub))
'(repl, string, count=0)'
>>> p.sub(

After "i.signature(" and "re.sub(" (both 'function's), the popup has the signature.  After p.sub (a 'builtin_function_or_method'), there is only the beginning of the doc string, as before.  Signature is not called because of the current guard.  It must be removed.

Returning _invalid_signature (defined in my patch) on ValueError should only be done when the message is 'invalid method signature'. (Can there be an invalid function signature that compiles?  In not, removing 'method' (in my patch) is a mistake).  signature(int) raises "no signature found for builtin type <class 'int'>".  In such cases, argspec should be left as '', to be augmented by the docstring as now.

Tests need to include some builtins that have been converted.  Serhiy, can you suggest a suitable module with converted functions and class methods?  Any of the builtins?
History
Date User Action Args
2017-05-04 05:59:39terry.reedysetrecipients: + terry.reedy, serhiy.storchaka, yselivanov, louielu
2017-05-04 05:59:39terry.reedysetmessageid: <1493877579.77.0.150232153234.issue19903@psf.upfronthosting.co.za>
2017-05-04 05:59:39terry.reedylinkissue19903 messages
2017-05-04 05:59:39terry.reedycreate