Closed
Description
>>> def function(duplicate, duplicate):
... pass
# Expected error message:
SyntaxError: duplicate argument 'duplicate' in function definition
# Actual error message:
SyntaxError: incomplete input
>>> def global_and_parameter(argument, /):
... global argument # It may not be clear for less experienced coders
# that a name cannot be global and parameter
SyntaxError: incomplete input
# However when executed with exec():
SyntaxError: name 'argument' is parameter and global
Linked PRs
- gh-111366: Correctly show custom syntax error messages in the codeop module functions #111384
- [3.11] gh-111366: Correctly show custom syntax error messages in the codeop module functions (GH-111384). #111516
- [3.12] gh-111366: Correctly show custom syntax error messages in the codeop module functions (GH-111384). #111517