Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)

* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
Akuli
2021-05-15 15:33:39 +03:00
committed by GitHub
parent b0ef85288d
commit 17dcea4a68
106 changed files with 1539 additions and 3275 deletions

View File

@@ -1,5 +1,5 @@
import sys
from sre_constants import (
SRE_FLAG_ASCII as SRE_FLAG_ASCII,
SRE_FLAG_DEBUG as SRE_FLAG_DEBUG,
SRE_FLAG_DOTALL as SRE_FLAG_DOTALL,
SRE_FLAG_IGNORECASE as SRE_FLAG_IGNORECASE,
@@ -11,21 +11,16 @@ from sre_constants import (
SRE_INFO_CHARSET as SRE_INFO_CHARSET,
SRE_INFO_LITERAL as SRE_INFO_LITERAL,
SRE_INFO_PREFIX as SRE_INFO_PREFIX,
_NamedIntConstant,
)
from sre_parse import SubPattern
from typing import Any, List, Pattern, Tuple, Type, Union
if sys.version_info >= (3,):
from sre_constants import SRE_FLAG_ASCII as SRE_FLAG_ASCII
from typing import Any, List, Pattern, Union
MAXCODE: int
if sys.version_info < (3, 0):
STRING_TYPES: Tuple[Type[str], Type[unicode]]
_IsStringType = int
else:
from sre_constants import _NamedIntConstant
def dis(code: List[_NamedIntConstant]) -> None: ...
_IsStringType = bool
def dis(code: List[_NamedIntConstant]) -> None: ...
_IsStringType = bool
def isstring(obj: Any) -> _IsStringType: ...
def compile(p: Union[str, bytes, SubPattern], flags: int = ...) -> Pattern[Any]: ...