mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
keyword: mark kwlist and softkwlist as Final (#9680)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from collections.abc import Sequence
|
||||
from typing_extensions import Final
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
__all__ = ["iskeyword", "issoftkeyword", "kwlist", "softkwlist"]
|
||||
@@ -8,8 +9,13 @@ else:
|
||||
|
||||
def iskeyword(s: str) -> bool: ...
|
||||
|
||||
kwlist: Sequence[str]
|
||||
# a list at runtime, but you're not meant to mutate it;
|
||||
# type it as a sequence
|
||||
kwlist: Final[Sequence[str]]
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def issoftkeyword(s: str) -> bool: ...
|
||||
softkwlist: Sequence[str]
|
||||
|
||||
# a list at runtime, but you're not meant to mutate it;
|
||||
# type it as a sequence
|
||||
softkwlist: Final[Sequence[str]]
|
||||
|
||||
Reference in New Issue
Block a user