bpo-33197: Update error message of invalid inspect.Parameters#6636
bpo-33197: Update error message of invalid inspect.Parameters#66361st1 merged 1 commit intopython:masterfrom
Conversation
|
For reviewers, Please add labels |
a226596 to
67478b6
Compare
serhiy-storchaka
left a comment
There was a problem hiding this comment.
kind can be not only _ParameterKind member here, but an integer. You need first make a _ParameterKind from it: _ParameterKind(kind).
There is the same formatting error at line 2465. The message at line 2739 can be improved too.
The message at line 2456 should contain the name of the type instead of the repr of the value.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be poked with soft cushions! |
|
@serhiy-storchaka |
96620b3 to
4fb6fca
Compare
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @serhiy-storchaka: please review the changes made to this pull request. |
1st1
left a comment
There was a problem hiding this comment.
This is a regression from blindly converting everything in stdlib to use enums. Thanks for fixing it!
I don't like the 'VAR_KEYWORD cannot have default values' message, it's rather cryptic. Please add a mapping of parameter-kinds to human-readable form and use that mapping to render good-looking error messages. Thanks!
Lib/inspect.py
Outdated
There was a problem hiding this comment.
Why did you remove 'parameters' word from the message?
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
@1st1 |
|
@1st1, @serhiy-storchaka: Updated! I will send a new PR about adding property after this PR is merged!(3.8) |
|
Please take a look if you have a time 👍 |
Lib/test/test_inspect.py
Outdated
Lib/test/test_inspect.py
Outdated
|
Thanks you for reviewing all 79 characters linting issues. I should care about this linting convention from now on. Thank you for redundunt reviewing for same issues :) Enjoy your weekend! thank you |
Lib/inspect.py
Outdated
There was a problem hiding this comment.
last change here:
raise ValueError(f'value {kind!r} is not a valid Parameter.kind')
Lib/inspect.py
Outdated
There was a problem hiding this comment.
"implicit arguments must be passed as positional or keyword arguments, not {}"
1st1
left a comment
There was a problem hiding this comment.
Left a couple nitpicks, please fix them. LGTM otherwise.
d6dde9d to
a466687
Compare
The error message from constructing invalid inspect. Parameters was confused due to print integer enum value (parameter kind). It is updated to print a string value of parameter kind.
|
Thanks! Updated! |
|
Thanks, @corona10 |
|
GH-7204 is a backport of this pull request to the 3.7 branch. |
…honGH-6636) (cherry picked from commit a9cab43) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
…honGH-6636) (cherry picked from commit a9cab43) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
|
GH-7205 is a backport of this pull request to the 3.6 branch. |
The error message from constructing invalid inspect.
Parameters was confused due to print integer enum value (parameter kind).
It is updated to print a string value of parameter kind.
https://bugs.python.org/issue33197