8000 `keyword`: mark `kwlist` and `softkwlist` as `Final` (#9680) · python/typeshed@cd5f976 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd5f976

Browse files
authored
keyword: mark kwlist and softkwlist as Final (#9680)
1 parent 88a761e commit cd5f976

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

stdlib/keyword.pyi

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
from collections.abc import Sequence
3+
from typing_extensions import Final
34

45
if sys.version_info >= (3, 9):
56
__all__ = ["iskeyword", "issoftkeyword", "kwlist", "softkwlist"]
@@ -8,8 +9,13 @@ else:
89

910
def iskeyword(s: str) -> bool: ...
1011

11-
kwlist: Sequence[str]
12+
# a list at runtime, but you're not meant to mutate it;
13+
# type it as a sequence
14+
kwlist: Final[Sequence[str]]
1215

1316
if sys.version_info >= (3, 9):
1417
def issoftkeyword(s: str) -> bool: ...
15-
softkwlist: Sequence[str]
18+
19+
# a list at runtime, but you're not meant to mutate it;
20+
# type it as a sequence
21+
softkwlist: Final[Sequence[str]]

0 commit comments

Comments
 (0)
0