mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Switch to PEP-604 syntax in python2 stubs (#5915)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import IO, Any, Callable, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union
|
||||
from typing import IO, Any, Callable, Iterator, List, MutableMapping, Text, Tuple, Type
|
||||
|
||||
_Reader = Callable[[IO[bytes]], Any]
|
||||
|
||||
@@ -25,7 +25,7 @@ def read_int4(f: IO[bytes]) -> int: ...
|
||||
|
||||
int4: ArgumentDescriptor
|
||||
|
||||
def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> Union[bytes, Text]: ...
|
||||
def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> bytes | Text: ...
|
||||
|
||||
stringnl: ArgumentDescriptor
|
||||
|
||||
@@ -77,9 +77,9 @@ long4: ArgumentDescriptor
|
||||
|
||||
class StackObject(object):
|
||||
name: str
|
||||
obtype: Union[Type[Any], Tuple[Type[Any], ...]]
|
||||
obtype: Type[Any] | Tuple[Type[Any], ...]
|
||||
doc: str
|
||||
def __init__(self, name: str, obtype: Union[Type[Any], Tuple[Type[Any], ...]], doc: str) -> None: ...
|
||||
def __init__(self, name: str, obtype: Type[Any] | Tuple[Type[Any], ...], doc: str) -> None: ...
|
||||
|
||||
pyint: StackObject
|
||||
pylong: StackObject
|
||||
@@ -99,7 +99,7 @@ stackslice: StackObject
|
||||
class OpcodeInfo(object):
|
||||
name: str
|
||||
code: str
|
||||
arg: Optional[ArgumentDescriptor]
|
||||
arg: ArgumentDescriptor | None
|
||||
stack_before: List[StackObject]
|
||||
stack_after: List[StackObject]
|
||||
proto: int
|
||||
@@ -108,7 +108,7 @@ class OpcodeInfo(object):
|
||||
self,
|
||||
name: str,
|
||||
code: str,
|
||||
arg: Optional[ArgumentDescriptor],
|
||||
arg: ArgumentDescriptor | None,
|
||||
stack_before: List[StackObject],
|
||||
stack_after: List[StackObject],
|
||||
proto: int,
|
||||
@@ -117,11 +117,8 @@ class OpcodeInfo(object):
|
||||
|
||||
opcodes: List[OpcodeInfo]
|
||||
|
||||
def genops(pickle: Union[bytes, IO[bytes]]) -> Iterator[Tuple[OpcodeInfo, Optional[Any], Optional[int]]]: ...
|
||||
def optimize(p: Union[bytes, IO[bytes]]) -> bytes: ...
|
||||
def genops(pickle: bytes | IO[bytes]) -> Iterator[Tuple[OpcodeInfo, Any | None, int | None]]: ...
|
||||
def optimize(p: bytes | IO[bytes]) -> bytes: ...
|
||||
def dis(
|
||||
pickle: Union[bytes, IO[bytes]],
|
||||
out: Optional[IO[str]] = ...,
|
||||
memo: Optional[MutableMapping[int, Any]] = ...,
|
||||
indentlevel: int = ...,
|
||||
pickle: bytes | IO[bytes], out: IO[str] | None = ..., memo: MutableMapping[int, Any] | None = ..., indentlevel: int = ...
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user