-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Right now it will generate this default error:
>>> class A[]: ...
File "<stdin>", line 1
class A[]: ...
^
SyntaxError: invalid syntax
>>> def some[](arg: int) -> None: ...
File "<stdin>", line 1
def some[](arg: int) -> None: ...
^
SyntaxError: expected '('
>>> type Alias[] = int
File "<stdin>", line 1
type Alias[] = int
^
SyntaxError: invalid syntax
I propose to change it to:
>>> class A[]:
File "<stdin>", line 1
class A[]:
^
SyntaxError: At least one type variable definition is expected
>>> def some[](arg: int) -> None: ...
File "<stdin>", line 1
def some[](arg: int) -> None: ...
^
SyntaxError: At least one type variable definition is expected
>>> type Alias[] = int
File "<stdin>", line 1
type Alias[] = int
^
SyntaxError: At least one type variable definition is expected
I have a PR ready.
Linked PRs
AlexWaygood, Eclips4 and aisk
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement