mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Added stub for sre_compile(2and3) (#1493)
This commit is contained in:
committed by
Jelle Zijlstra
parent
cb1d150092
commit
c5439668fe
18
stdlib/2and3/sre_compile.pyi
Normal file
18
stdlib/2and3/sre_compile.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_compile.py
|
||||
# and https://github.com/python/cpython/blob/master/Lib/sre_compile.py
|
||||
|
||||
import sys
|
||||
from sre_parse import SubPattern
|
||||
from typing import Any, List, Pattern, Tuple, Type, TypeVar, Union
|
||||
|
||||
MAXCODE = ... # type: 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 isstring(obj: Any) -> _IsStringType: ...
|
||||
def compile(p: Union[str, bytes, SubPattern], flags: int = ...) -> Pattern: ...
|
||||
Reference in New Issue
Block a user