mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use PEP 604 syntax wherever possible, part II (#7514)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from sre_constants import *
|
||||
from sre_constants import _NamedIntConstant as _NIC, error as _Error
|
||||
from typing import Any, Iterable, Match, Optional, Pattern as _Pattern, overload
|
||||
from typing import Any, Iterable, Match, Pattern as _Pattern, overload
|
||||
|
||||
SPECIAL_CHARS: str
|
||||
REPEAT_CHARS: str
|
||||
@@ -37,7 +37,7 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
Pattern = _State
|
||||
|
||||
_OpSubpatternType = tuple[Optional[int], int, int, SubPattern]
|
||||
_OpSubpatternType = tuple[int | None, int, int, SubPattern]
|
||||
_OpGroupRefExistsType = tuple[int, SubPattern, SubPattern]
|
||||
_OpInType = list[tuple[_NIC, int]]
|
||||
_OpBranchType = tuple[None, list[SubPattern]]
|
||||
@@ -87,8 +87,8 @@ class Tokenizer:
|
||||
|
||||
def fix_flags(src: str | bytes, flags: int) -> int: ...
|
||||
|
||||
_TemplateType = tuple[list[tuple[int, int]], list[Optional[str]]]
|
||||
_TemplateByteType = tuple[list[tuple[int, int]], list[Optional[bytes]]]
|
||||
_TemplateType = tuple[list[tuple[int, int]], list[str | None]]
|
||||
_TemplateByteType = tuple[list[tuple[int, int]], list[bytes | None]]
|
||||
if sys.version_info >= (3, 8):
|
||||
def parse(str: str, flags: int = ..., state: State | None = ...) -> SubPattern: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user