Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-92062: inspect.Parameter checks whether name is a keyword #92065

Merged
merged 3 commits into from
May 3, 2022

Conversation

Zac-HD
Copy link
Contributor

@Zac-HD Zac-HD commented Apr 30, 2022

Fixes #92062.

Automerge-Triggered-By: GH:pganssle

@AlexWaygood AlexWaygood added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Apr 30, 2022
@Zac-HD
Copy link
Contributor Author

Zac-HD commented Apr 30, 2022

I just can't understand why make patchcheck is complaining about whitespace in inspect.py 😕

@JelleZijlstra
Copy link
Member

I just can't understand why make patchcheck is complaining about whitespace in inspect.py 😕

There is some pre-existing trailing whitespace in the file (around lines 1648 and 1686). make patchcheck runs only on changed files and we don't have a check to make sure it passes on unchanged files (sorry for that). You should probably just fix the trailing whitespace.

Zac-HD added 2 commits April 29, 2022 22:37
Jelle pointed out that this might occur in C functions, and so to avoid breaking any existing (if strange) code we'll only check params which can be called with named arguments.
@Zac-HD
Copy link
Contributor Author

Zac-HD commented Apr 30, 2022

Oh, easy to fix now that I know what's happening! Thanks for the quick response 🤩

(Perhaps the patchcheck job could also run a git diff so that contributors can see the problem?)

@miss-islington miss-islington merged commit 65f88a6 into python:main May 3, 2022
@Zac-HD Zac-HD deleted the zac-hd/error-on-keyword-params branch May 3, 2022 20:52
@pganssle
Copy link
Member

pganssle commented May 3, 2022

This seems like it should be uncontroversial enough (famous last words — I'm sure someone is going to show up complaining that they use invalid signature objects as some load-bearing part of their workflow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inspect.Parameter checks that name is an identifier, but does not check for keywords
6 participants