Skip to content

Commit d1cdda5

Browse files
committed
add "type" to soft keyword check
1 parent c779f23 commit d1cdda5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lib/_pyrepl/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ def is_soft_keyword_used(*tokens: TI | None) -> bool:
257257
return True
258258
case (TI(string="case"), TI(string="_"), TI(string=":")):
259259
return True
260+
case (
261+
None | TI(T.NEWLINE) | TI(T.INDENT) | TI(string=":"),
262+
TI(string="type"),
263+
TI(T.NAME, string=s)
264+
):
265+
if keyword.iskeyword(s):
266+
return False
267+
return True
260268
case _:
261269
return False
262270

0 commit comments

Comments
 (0)