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
Confusing error message when constructing invalid inspect.Parameters #77378
Comments
Python 3.6.4
ValueError Traceback (most recent call last)
<ipython-input-15-7ed8c4fd15f3> in <module>()
----> 1 inspect.Parameter("foo", kind=inspect.Parameter.VAR_KEYWORD, default=42)
Note the "interesting" error message that starts with "4 parameters ..." (yes, I guess that inspect.Parameter == 4 internally...). Probably just a matter of making the error f'{kind.name} parameters ...'. |
@antony Lee since you know the fix, do you want to submit a PR? |
Also, _ParameterKind class has a __str__ method. So, I guess it's better to use "{!s}" in the format string instead of using kind.name. |
I will take a look this issue. |
Can I get a code review for PR 6636? |
PR 6636 is ready to be merged :) |
@yselivanov Please take a look PR 7206 :) |
Thanks! |
We forgot to add "versionadded: 3.8" tag to the documentation of ParameterKind.description. Dong-hee Na, could you please make a PR to add it? |
Sure, I will send a PR soon. |
@yselivanov Please take a look PR 7536 :) Thanks! |
Please stop posting comments like this frequently. They are highly distractive. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: