Skip to content

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 Standard Library Python modules in the Lib/ directory 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).

@Ark-kun
Copy link

Ark-kun commented May 24, 2025

I'm sure someone is going to show up complaining that they use invalid signature objects as some load-bearing part of their workflow

Sorry for making you wait so long.

So, for many years we were dynamically generating functions based on interface described in YAML files. With Python 3.9 our tests started to fail. Turns out we had some cases where a parameter with name in was being generated. I wonder whether the actual generated low-level functions worked in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stdlib Standard Library Python modules in the Lib/ directory 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

7 participants