-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error