Remove Python 3.6 branches from typeshed (#8269)

This commit is contained in:
Alex Waygood
2022-07-11 09:55:17 +01:00
committed by GitHub
parent 29c17ffb47
commit edc0ecd857
114 changed files with 1016 additions and 2642 deletions

View File

@@ -4,15 +4,9 @@ import sys
from _typeshed import ReadableBuffer
from collections.abc import Callable, Iterator
from sre_constants import error as error
from typing import Any, AnyStr, overload
from typing import Any, AnyStr, Match as Match, Pattern as Pattern, overload
from typing_extensions import TypeAlias
# ----- re variables and constants -----
if sys.version_info >= (3, 7):
from typing import Match as Match, Pattern as Pattern
else:
from typing import Match, Pattern
__all__ = [
"match",
"fullmatch",
@@ -41,14 +35,15 @@ __all__ = [
"DOTALL",
"VERBOSE",
"UNICODE",
"Match",
"Pattern",
]
if sys.version_info >= (3, 7):
__all__ += ["Match", "Pattern"]
if sys.version_info >= (3, 11):
__all__ += ["NOFLAG", "RegexFlag"]
# ----- re variables and constants -----
class RegexFlag(enum.IntFlag):
A = sre_compile.SRE_FLAG_ASCII
ASCII = A
@@ -91,10 +86,6 @@ if sys.version_info >= (3, 11):
NOFLAG = RegexFlag.NOFLAG
_FlagsType: TypeAlias = int | RegexFlag
if sys.version_info < (3, 7):
# undocumented
_pattern_type: type
# Type-wise the compile() overloads are unnecessary, they could also be modeled using
# unions in the parameter types. However mypy has a bug regarding TypeVar
# constraints (https://github.com/python/mypy/issues/11880),