-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Open
Labels
easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
Syntax warnings for code like [][""], [](), and 1[2] finish with the hint "perhaps you missed a comma?"
>>> lambda: 1[2]
<python-input-23>:1: SyntaxWarning: 'int' object is not subscriptable; perhaps you missed a comma?
<function <lambda> at 0x705dfb04b920>When this came up in a review of currently emitted syntax warnings, it took me a moment to realise that it was suggesting the two subexpressions might have been supposed to be separate items in a sequence definition.
While I expect this would be clearer in the context of an actual warning, in isolation it felt very cryptic. Perhaps it would make sense to expand the hint to "did you miss a comma to separate sequence elements?"
Edit: Amended proposed text as @hugovk suggested
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-featureA feature request or enhancementA feature request or enhancement