Skip to content

Commit a0db1ba

Browse files
authored
Mark optparse constants as final (#13451)
1 parent 30a4d10 commit a0db1ba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/optparse.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import builtins
22
from _typeshed import MaybeNone, SupportsWrite
33
from abc import abstractmethod
44
from collections.abc import Callable, Iterable, Mapping, Sequence
5-
from typing import Any, ClassVar, Literal, NoReturn, overload
5+
from typing import Any, ClassVar, Final, Literal, NoReturn, overload
66
from typing_extensions import Self
77

88
__all__ = [
@@ -24,10 +24,10 @@ __all__ = [
2424
"BadOptionError",
2525
"check_choice",
2626
]
27-
28-
NO_DEFAULT: tuple[str, ...]
29-
SUPPRESS_HELP: str
30-
SUPPRESS_USAGE: str
27+
# pytype is not happy with `NO_DEFAULT: Final = ("NO", "DEFAULT")`
28+
NO_DEFAULT: Final[tuple[Literal["NO"], Literal["DEFAULT"]]]
29+
SUPPRESS_HELP: Final = "SUPPRESSHELP"
30+
SUPPRESS_USAGE: Final = "SUPPRESSUSAGE"
3131

3232
# Can return complex, float, or int depending on the option's type
3333
def check_builtin(option: Option, opt: str, value: str) -> complex: ...

0 commit comments

Comments
 (0)