Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Lib/_pyrepl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ def is_soft_keyword_used(*tokens: TI | None) -> bool:
return True
case (TI(string="case"), TI(string="_"), TI(string=":")):
return True
case (
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(string=":"),
TI(string="type"),
TI(T.NAME, string=s)
):
if keyword.iskeyword(s):
return False
return True
case _:
return False

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The REPL now highlights "type" as a soft keyword in type statements.
Loading