◐ Shell
reader mode source ↗
Skip to content

bpo-19903: IDLE: Calltips changed to use inspect.signature#2822

Merged
terryjreedy merged 10 commits into
python:masterfrom
mlouielu:bpo-19903
Aug 10, 2017
Merged

bpo-19903: IDLE: Calltips changed to use inspect.signature#2822
terryjreedy merged 10 commits into
python:masterfrom
mlouielu:bpo-19903

Conversation

@mlouielu

@mlouielu mlouielu commented Jul 23, 2017

Copy link
Copy Markdown
Contributor

This commit change the get_argspec from using inspect.getfullargspec
to inspect.signature. It will improve the tip message for use.

Also, if object is not callable, now will return this message for
user, not blank tips. If the methods has an invalid method signature,
it will also return message to user.

Re-open from #1382

https://bugs.python.org/issue19903

@mention-bot

Copy link
Copy Markdown

@mlouielu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @terryjreedy, @kbkaiser and @serhiy-storchaka to be potential reviewers.

@terryjreedy

Copy link
Copy Markdown
Member

Louie, I cannot add commits to this issue, and a few others of yours and others. Please follow the instructions at https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/#enabling-repository-maintainer-permissions-on-existing-pull-requests to make sure "Allow edits from maintainers." is checked for this and other IDLE issues. Please let me know what you found. If that is already checked, then I have some other problem with github.

@mlouielu

Copy link
Copy Markdown
Contributor Author

@terryjreedy The check is on now. Hmmm, I thought that is default to check-up? FWIR this has been discussed on python-committers before?

@terryjreedy

Copy link
Copy Markdown
Member

There seems to have been a problem with a robot unchecking the edit switch under some circumstances. Since patched.

@terryjreedy terryjreedy self-requested a review August 2, 2017 21:46
@terryjreedy terryjreedy self-assigned this Aug 2, 2017
@terryjreedy

terryjreedy commented Aug 2, 2017

Copy link
Copy Markdown
Member

I want to make a few minor changes, do some live tests, and merge. But when I tried to make a local PR, git trapped my clone in a loop. See core-mentorship. Fixed

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

I wrote minor changes I planned to write, to make code slightly clearer. The should not affect tests.

PR also needs a blurb added. The title line might be enough. In any case, web edit works well for blurbs.

This commit change the get_argspec from using inspect.getfullargspec
to inspect.signature. It will improve the tip message for use.

Also, if object is not callable, now will return this message for
user, not blank tips. If the methods has an invalid method signature,
it will also return message to user.

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

I am doing some manual checking while waiting for CI, but expect to merge.

@mlouielu

mlouielu commented Aug 4, 2017

Copy link
Copy Markdown
Contributor Author

@terryjreedy Can this be backported to 3.5 and 3.6?

@terryjreedy

Copy link
Copy Markdown
Member

Funny you should ask. When 3.6.0b1 came out, I stopped backporting to anything before 3.6: too much work and too much danger of regressions. In testing this, I noticed that ')' no longer closes calltips -- a bad regression since 3.6.2. Since repository 3.6.2+ has the same problem, it is definitely not this patch. I suspect bpo-30723. Of course, there is no test of such behaviors.

That aside, this patch would have less effect in 3.5 (pre-Arg Clinic, I believe), and the
last 3.5 maintenance release candidate is already out, so it is effectively in security-fix only mode.

too dangerousCurrently, everything is backported to 3.6, and only 3.6. The last 3.5 maintenance release candidate was issued a week ago, so it is effectively in security-only mode.

@mlouielu

mlouielu commented Aug 8, 2017

Copy link
Copy Markdown
Contributor Author

This PR should be block until the regression of not closing tipbox been fixed.

I don't think the problem came from #2306, I test it on mac first git pr 2822, then git revert fae2c3538e, the problem still exists.

@mlouielu

mlouielu commented Aug 8, 2017

Copy link
Copy Markdown
Contributor Author

Block fixed by 8922587

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

Requested changes made, some with improvements.

@terryjreedy terryjreedy merged commit 3b0f620 into python:master Aug 10, 2017
@bedevere-bot

Copy link
Copy Markdown

GH-3053 is a backport of this pull request to the 3.6 branch.

terryjreedy pushed a commit to terryjreedy/cpython that referenced this pull request Aug 10, 2017
terryjreedy added a commit to terryjreedy/cpython that referenced this pull request Aug 10, 2017
…honGH-2822)

Idlelib.calltips.get_argspec now uses inspect.signature instead of inspect.getfullargspec, like help() does.  This improves the signature in the call tip in a few different cases, including builtins converted to provide a signature.  A message is added if the object is not callable, has an invalid signature, or if it has positional-only parameters.
Patch by Louie Lu..
(cherry picked from commit 3b0f620)
terryjreedy added a commit that referenced this pull request Aug 10, 2017
…2822) (#3053)

Idlelib.calltips.get_argspec now uses inspect.signature instead of inspect.getfullargspec, like help() does.  This improves the signature in the call tip in a few different cases, including builtins converted to provide a signature.  A message is added if the object is not callable, has an invalid signature, or if it has positional-only parameters.
Patch by Louie Lu..
(cherry picked from commit 3b0f620)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants