Remove some pytype workarounds from stdlib (#14470)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-07-27 11:56:26 +01:00
1 parent 1a256d8211
commit 7e16c80989
8 files changed
+10 -40

No files matched your search

+1 -3
View File
@@ -239,9 +239,7 @@ if sys.version_info < (3, 13):
T: Final = RegexFlag.T
TEMPLATE: Final = RegexFlag.TEMPLATE
if sys.version_info >= (3, 11):
# pytype chokes on `NOFLAG: Final = RegexFlag.NOFLAG` with `LiteralValueError`
# mypy chokes on `NOFLAG: Final[Literal[RegexFlag.NOFLAG]]` with `Literal[...] is invalid`
NOFLAG = RegexFlag.NOFLAG
NOFLAG: Final = RegexFlag.NOFLAG
_FlagsType: TypeAlias = int | RegexFlag
# Type-wise the compile() overloads are unnecessary, they could also be modeled using