mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 08:04:24 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Stubs for pickletools (Python 2 and 3)
|
||||
import sys
|
||||
from typing import Any, Callable, IO, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union
|
||||
from typing import IO, Any, Callable, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union
|
||||
|
||||
_Reader = Callable[[IO[bytes]], Any]
|
||||
|
||||
@@ -23,12 +23,15 @@ class ArgumentDescriptor(object):
|
||||
def __init__(self, name: str, n: int, reader: _Reader, doc: str) -> None: ...
|
||||
|
||||
def read_uint1(f: IO[bytes]) -> int: ...
|
||||
|
||||
uint1: ArgumentDescriptor
|
||||
|
||||
def read_uint2(f: IO[bytes]) -> int: ...
|
||||
|
||||
uint2: ArgumentDescriptor
|
||||
|
||||
def read_int4(f: IO[bytes]) -> int: ...
|
||||
|
||||
int4: ArgumentDescriptor
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
@@ -40,24 +43,28 @@ if sys.version_info >= (3, 5):
|
||||
uint8: ArgumentDescriptor
|
||||
|
||||
def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> Union[bytes, Text]: ...
|
||||
|
||||
stringnl: ArgumentDescriptor
|
||||
|
||||
def read_stringnl_noescape(f: IO[bytes]) -> str: ...
|
||||
|
||||
stringnl_noescape: ArgumentDescriptor
|
||||
|
||||
def read_stringnl_noescape_pair(f: IO[bytes]) -> Text: ...
|
||||
|
||||
stringnl_noescape_pair: ArgumentDescriptor
|
||||
|
||||
def read_string1(f: IO[bytes]) -> str: ...
|
||||
|
||||
string1: ArgumentDescriptor
|
||||
|
||||
def read_string4(f: IO[bytes]) -> str: ...
|
||||
|
||||
string4: ArgumentDescriptor
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
def read_bytes1(f: IO[bytes]) -> bytes: ...
|
||||
bytes1: ArgumentDescriptor
|
||||
|
||||
def read_bytes4(f: IO[bytes]) -> bytes: ...
|
||||
bytes4: ArgumentDescriptor
|
||||
|
||||
@@ -66,6 +73,7 @@ if sys.version_info >= (3, 4):
|
||||
bytes8: ArgumentDescriptor
|
||||
|
||||
def read_unicodestringnl(f: IO[bytes]) -> Text: ...
|
||||
|
||||
unicodestringnl: ArgumentDescriptor
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
@@ -73,6 +81,7 @@ if sys.version_info >= (3, 4):
|
||||
unicodestring1: ArgumentDescriptor
|
||||
|
||||
def read_unicodestring4(f: IO[bytes]) -> Text: ...
|
||||
|
||||
unicodestring4: ArgumentDescriptor
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
@@ -81,19 +90,24 @@ if sys.version_info >= (3, 4):
|
||||
|
||||
def read_decimalnl_short(f: IO[bytes]) -> int: ...
|
||||
def read_decimalnl_long(f: IO[bytes]) -> int: ...
|
||||
|
||||
decimalnl_short: ArgumentDescriptor
|
||||
decimalnl_long: ArgumentDescriptor
|
||||
|
||||
def read_floatnl(f: IO[bytes]) -> float: ...
|
||||
|
||||
floatnl: ArgumentDescriptor
|
||||
|
||||
def read_float8(f: IO[bytes]) -> float: ...
|
||||
|
||||
float8: ArgumentDescriptor
|
||||
|
||||
def read_long1(f: IO[bytes]) -> int: ...
|
||||
|
||||
long1: ArgumentDescriptor
|
||||
|
||||
def read_long4(f: IO[bytes]) -> int: ...
|
||||
|
||||
long4: ArgumentDescriptor
|
||||
|
||||
class StackObject(object):
|
||||
@@ -132,14 +146,35 @@ class OpcodeInfo(object):
|
||||
stack_after: List[StackObject]
|
||||
proto: int
|
||||
doc: str
|
||||
def __init__(self, name: str, code: str, arg: Optional[ArgumentDescriptor],
|
||||
stack_before: List[StackObject], stack_after: List[StackObject], proto: int, doc: str) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
code: str,
|
||||
arg: Optional[ArgumentDescriptor],
|
||||
stack_before: List[StackObject],
|
||||
stack_after: List[StackObject],
|
||||
proto: int,
|
||||
doc: str,
|
||||
) -> None: ...
|
||||
|
||||
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: ...
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ..., annotate: int = ...) -> None: ...
|
||||
def dis(
|
||||
pickle: Union[bytes, IO[bytes]],
|
||||
out: Optional[IO[str]] = ...,
|
||||
memo: Optional[MutableMapping[int, Any]] = ...,
|
||||
indentlevel: int = ...,
|
||||
annotate: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ...) -> None: ...
|
||||
def dis(
|
||||
pickle: Union[bytes, IO[bytes]],
|
||||
out: Optional[IO[str]] = ...,
|
||||
memo: Optional[MutableMapping[int, Any]] = ...,
|
||||
indentlevel: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user