mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Remove Python 3.6 branches from typeshed (#8269)
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user