mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-21 03:11:16 +08:00
Consistently use '= ...' for optional parameters.
This commit is contained in:
@@ -14,11 +14,11 @@ REMAINDER = ... # type: Any
|
||||
class _AttributeHolder: ...
|
||||
|
||||
class HelpFormatter:
|
||||
def __init__(self, prog, indent_increment=2, max_help_position=24, width=None) -> None: ...
|
||||
def __init__(self, prog, indent_increment=..., max_help_position=..., width=...) -> None: ...
|
||||
def start_section(self, heading): ...
|
||||
def end_section(self): ...
|
||||
def add_text(self, text): ...
|
||||
def add_usage(self, usage, actions, groups, prefix=None): ...
|
||||
def add_usage(self, usage, actions, groups, prefix=...): ...
|
||||
def add_argument(self, action): ...
|
||||
def add_arguments(self, actions): ...
|
||||
def format_help(self): ...
|
||||
@@ -46,58 +46,58 @@ class Action(_AttributeHolder):
|
||||
required = ... # type: Any
|
||||
help = ... # type: Any
|
||||
metavar = ... # type: Any
|
||||
def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None,
|
||||
choices=None, required=False, help=None, metavar=None): ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __init__(self, option_strings, dest, nargs=..., const=..., default=..., type=...,
|
||||
choices=..., required=..., help=..., metavar=...): ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class _StoreAction(Action):
|
||||
def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None,
|
||||
choices=None, required=False, help=None, metavar=None): ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __init__(self, option_strings, dest, nargs=..., const=..., default=..., type=...,
|
||||
choices=..., required=..., help=..., metavar=...): ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class _StoreConstAction(Action):
|
||||
def __init__(self, option_strings, dest, const, default=None, required=False, help=None,
|
||||
metavar=None): ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __init__(self, option_strings, dest, const, default=..., required=..., help=...,
|
||||
metavar=...): ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class _StoreTrueAction(_StoreConstAction):
|
||||
def __init__(self, option_strings, dest, default=False, required=False, help=None) -> None: ...
|
||||
def __init__(self, option_strings, dest, default=..., required=..., help=...) -> None: ...
|
||||
|
||||
class _StoreFalseAction(_StoreConstAction):
|
||||
def __init__(self, option_strings, dest, default=True, required=False, help=None) -> None: ...
|
||||
def __init__(self, option_strings, dest, default=..., required=..., help=...) -> None: ...
|
||||
|
||||
class _AppendAction(Action):
|
||||
def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None,
|
||||
choices=None, required=False, help=None, metavar=None): ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __init__(self, option_strings, dest, nargs=..., const=..., default=..., type=...,
|
||||
choices=..., required=..., help=..., metavar=...): ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class _AppendConstAction(Action):
|
||||
def __init__(self, option_strings, dest, const, default=None, required=False, help=None,
|
||||
metavar=None): ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __init__(self, option_strings, dest, const, default=..., required=..., help=...,
|
||||
metavar=...): ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class _CountAction(Action):
|
||||
def __init__(self, option_strings, dest, default=None, required=False, help=None) -> None: ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __init__(self, option_strings, dest, default=..., required=..., help=...) -> None: ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class _HelpAction(Action):
|
||||
def __init__(self, option_strings, dest=..., default=..., help=None) -> None: ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __init__(self, option_strings, dest=..., default=..., help=...) -> None: ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class _VersionAction(Action):
|
||||
version = ... # type: Any
|
||||
def __init__(self, option_strings, version=None, dest=..., default=...,
|
||||
help=''): ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __init__(self, option_strings, version=..., dest=..., default=...,
|
||||
help=...): ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class _SubParsersAction(Action):
|
||||
def __init__(self, option_strings, prog, parser_class, dest=..., help=None,
|
||||
metavar=None): ...
|
||||
def __init__(self, option_strings, prog, parser_class, dest=..., help=...,
|
||||
metavar=...): ...
|
||||
def add_parser(self, name, **kwargs): ...
|
||||
def __call__(self, parser, namespace, values, option_string=None): ...
|
||||
def __call__(self, parser, namespace, values, option_string=...): ...
|
||||
|
||||
class FileType:
|
||||
def __init__(self, mode='', bufsize=-1, encoding=None, errors=None) -> None: ...
|
||||
def __init__(self, mode=..., bufsize=..., encoding=..., errors=...) -> None: ...
|
||||
def __call__(self, string): ...
|
||||
|
||||
class Namespace(_AttributeHolder):
|
||||
@@ -117,27 +117,27 @@ class _ActionsContainer:
|
||||
def get_default(self, dest): ...
|
||||
def add_argument(self,
|
||||
*args: str,
|
||||
action: str = None,
|
||||
nargs: str = None,
|
||||
const: Any = None,
|
||||
default: Any = None,
|
||||
type: Any = None,
|
||||
choices: Any = None, # TODO: Container?
|
||||
required: bool = None,
|
||||
help: str = None,
|
||||
metavar: str = None,
|
||||
dest: str = None
|
||||
action: str = ...,
|
||||
nargs: str = ...,
|
||||
const: Any = ...,
|
||||
default: Any = ...,
|
||||
type: Any = ...,
|
||||
choices: Any = ..., # TODO: Container?
|
||||
required: bool = ...,
|
||||
help: str = ...,
|
||||
metavar: str = ...,
|
||||
dest: str = ...
|
||||
) -> None: ...
|
||||
def add_argument_group(self, *args, **kwargs): ...
|
||||
def add_mutually_exclusive_group(self, **kwargs): ...
|
||||
|
||||
class _ArgumentGroup(_ActionsContainer):
|
||||
title = ... # type: Any
|
||||
def __init__(self, container, title=None, description=None, **kwargs) -> None: ...
|
||||
def __init__(self, container, title=..., description=..., **kwargs) -> None: ...
|
||||
|
||||
class _MutuallyExclusiveGroup(_ArgumentGroup):
|
||||
required = ... # type: Any
|
||||
def __init__(self, container, required=False) -> None: ...
|
||||
def __init__(self, container, required=...) -> None: ...
|
||||
|
||||
class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
prog = ... # type: Any
|
||||
@@ -146,16 +146,16 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
formatter_class = ... # type: Any
|
||||
fromfile_prefix_chars = ... # type: Any
|
||||
add_help = ... # type: Any
|
||||
def __init__(self, prog=None, usage=None, description=None, epilog=None, parents=...,
|
||||
formatter_class=..., prefix_chars='', fromfile_prefix_chars=None,
|
||||
argument_default=None, conflict_handler='', add_help=True): ...
|
||||
def __init__(self, prog=..., usage=..., description=..., epilog=..., parents=...,
|
||||
formatter_class=..., prefix_chars=..., fromfile_prefix_chars=...,
|
||||
argument_default=..., conflict_handler=..., add_help=...): ...
|
||||
def add_subparsers(self, **kwargs): ...
|
||||
def parse_args(self, args: Sequence[str] = None, namespace=None) -> Any: ...
|
||||
def parse_known_args(self, args=None, namespace=None): ...
|
||||
def parse_args(self, args: Sequence[str] = ..., namespace=...) -> Any: ...
|
||||
def parse_known_args(self, args=..., namespace=...): ...
|
||||
def convert_arg_line_to_args(self, arg_line): ...
|
||||
def format_usage(self): ...
|
||||
def format_help(self): ...
|
||||
def print_usage(self, file=None): ...
|
||||
def print_help(self, file=None): ...
|
||||
def exit(self, status=0, message=None): ...
|
||||
def print_usage(self, file=...): ...
|
||||
def print_help(self, file=...): ...
|
||||
def exit(self, status=..., message=...): ...
|
||||
def error(self, message): ...
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
|
||||
from typing import IO
|
||||
|
||||
def b64encode(s: bytes, altchars: bytes = None) -> bytes: ...
|
||||
def b64decode(s: bytes, altchars: bytes = None,
|
||||
validate: bool = False) -> bytes: ...
|
||||
def b64encode(s: bytes, altchars: bytes = ...) -> bytes: ...
|
||||
def b64decode(s: bytes, altchars: bytes = ...,
|
||||
validate: bool = ...) -> bytes: ...
|
||||
def standard_b64encode(s: bytes) -> bytes: ...
|
||||
def standard_b64decode(s: bytes) -> bytes: ...
|
||||
def urlsafe_b64encode(s: bytes) -> bytes: ...
|
||||
def urlsafe_b64decode(s: bytes) -> bytes: ...
|
||||
def b32encode(s: bytes) -> bytes: ...
|
||||
def b32decode(s: bytes, casefold: bool = False,
|
||||
map01: bytes = None) -> bytes: ...
|
||||
def b32decode(s: bytes, casefold: bool = ...,
|
||||
map01: bytes = ...) -> bytes: ...
|
||||
def b16encode(s: bytes) -> bytes: ...
|
||||
def b16decode(s: bytes, casefold: bool = False) -> bytes: ...
|
||||
def b16decode(s: bytes, casefold: bool = ...) -> bytes: ...
|
||||
|
||||
def decode(input: IO[bytes], output: IO[bytes]) -> None: ...
|
||||
def decodebytes(s: bytes) -> bytes: ...
|
||||
|
||||
@@ -2,11 +2,11 @@ from typing import Sequence, TypeVar
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
def insort_left(a: Sequence[_T], x: _T, lo: int = 0, hi: int = None): pass
|
||||
def insort_right(a: Sequence[_T], x: _T, lo: int = 0, hi: int = None): pass
|
||||
def insort_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...): pass
|
||||
def insort_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...): pass
|
||||
|
||||
def bisect_left(a: Sequence[_T], x: _T, lo: int = 0, hi: int = None): pass
|
||||
def bisect_right(a: Sequence[_T], x: _T, lo: int = 0, hi: int = None): pass
|
||||
def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...): pass
|
||||
def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...): pass
|
||||
|
||||
insort = insort_right
|
||||
bisect = bisect_right
|
||||
|
||||
@@ -1 +1 @@
|
||||
def escape(s: str, quote: bool = False) -> str: ...
|
||||
def escape(s: str, quote: bool = ...) -> str: ...
|
||||
|
||||
@@ -32,15 +32,15 @@ _incremental_encoder_type = Callable[[], 'IncrementalEncoder'] # signature of In
|
||||
_incremental_decode_type = Callable[[], 'IncrementalDecoder'] # signature of IncrementalDecoder __init__
|
||||
|
||||
|
||||
def encode(obj: _decoded, encoding: str = 'utf-8', errors: str = 'strict') -> _encoded:
|
||||
def encode(obj: _decoded, encoding: str = ..., errors: str = ...) -> _encoded:
|
||||
...
|
||||
def decode(obj: _encoded, encoding: str = 'utf-8', errors: str = 'strict') -> _decoded:
|
||||
def decode(obj: _encoded, encoding: str = ..., errors: str = ...) -> _decoded:
|
||||
...
|
||||
|
||||
def lookup(encoding: str) -> 'CodecInfo':
|
||||
...
|
||||
class CodecInfo(Tuple[_encode_type, _decode_type, _stream_reader_type, _stream_writer_type]):
|
||||
def __init__(self, encode: _encode_type, decode: _decode_type, streamreader: _stream_reader_type = None, streamwriter: _stream_writer_type = None, incrementalencoder: _incremental_encoder_type = None, incrementaldecoder: _incremental_decode_type = None, name: str = None) -> None:
|
||||
def __init__(self, encode: _encode_type, decode: _decode_type, streamreader: _stream_reader_type = ..., streamwriter: _stream_writer_type = ..., incrementalencoder: _incremental_encoder_type = ..., incrementaldecoder: _incremental_decode_type = ..., name: str = ...) -> None:
|
||||
self.encode = encode
|
||||
self.decode = decode
|
||||
self.streamreader = streamreader
|
||||
@@ -65,15 +65,15 @@ def getwriter(encoding: str) -> _stream_writer_type:
|
||||
def register(search_function: Callable[[str], CodecInfo]) -> None:
|
||||
...
|
||||
|
||||
def open(filename: str, mode: str = 'r', encoding: str = None, errors: str = 'strict', buffering: int = 1) -> StreamReaderWriter:
|
||||
def open(filename: str, mode: str = ..., encoding: str = ..., errors: str = ..., buffering: int = ...) -> StreamReaderWriter:
|
||||
...
|
||||
|
||||
def EncodedFile(file: BinaryIO, data_encoding: str, file_encoding: str = None, errors = 'strict') -> 'StreamRecoder':
|
||||
def EncodedFile(file: BinaryIO, data_encoding: str, file_encoding: str = ..., errors = ...) -> 'StreamRecoder':
|
||||
...
|
||||
|
||||
def iterencode(iterator: Iterable[_decoded], encoding: str, errors: str = 'strict') -> Iterator[_encoded]:
|
||||
def iterencode(iterator: Iterable[_decoded], encoding: str, errors: str = ...) -> Iterator[_encoded]:
|
||||
...
|
||||
def iterdecode(iterator: Iterable[_encoded], encoding: str, errors: str = 'strict') -> Iterator[_decoded]:
|
||||
def iterdecode(iterator: Iterable[_encoded], encoding: str, errors: str = ...) -> Iterator[_decoded]:
|
||||
...
|
||||
|
||||
BOM = b''
|
||||
@@ -109,16 +109,16 @@ def backslashreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes],
|
||||
class Codec:
|
||||
# These are sort of @abstractmethod but sort of not.
|
||||
# The StreamReader and StreamWriter subclasses only implement one.
|
||||
def encode(self, input: _decoded, errors: str = 'strict') -> Tuple[_encoded, int]:
|
||||
def encode(self, input: _decoded, errors: str = ...) -> Tuple[_encoded, int]:
|
||||
...
|
||||
def decode(self, input: _encoded, errors: str = 'strict') -> Tuple[_decoded, int]:
|
||||
def decode(self, input: _encoded, errors: str = ...) -> Tuple[_decoded, int]:
|
||||
...
|
||||
|
||||
class IncrementalEncoder:
|
||||
def __init__(self, errors: str = 'strict') -> None:
|
||||
def __init__(self, errors: str = ...) -> None:
|
||||
self.errors = errors
|
||||
@abstractmethod
|
||||
def encode(self, object: _decoded, final: bool = False) -> _encoded:
|
||||
def encode(self, object: _decoded, final: bool = ...) -> _encoded:
|
||||
...
|
||||
def reset(self) -> None:
|
||||
...
|
||||
@@ -129,10 +129,10 @@ class IncrementalEncoder:
|
||||
...
|
||||
|
||||
class IncrementalDecoder:
|
||||
def __init__(self, errors: str = 'strict') -> None:
|
||||
def __init__(self, errors: str = ...) -> None:
|
||||
self.errors = errors
|
||||
@abstractmethod
|
||||
def decode(self, object: _encoded, final: bool = False) -> _decoded:
|
||||
def decode(self, object: _encoded, final: bool = ...) -> _decoded:
|
||||
...
|
||||
def reset(self) -> None:
|
||||
...
|
||||
@@ -143,28 +143,28 @@ class IncrementalDecoder:
|
||||
|
||||
# These are not documented but used in encodings/*.py implementations.
|
||||
class BufferedIncrementalEncoder(IncrementalEncoder):
|
||||
def __init__(self, errors: str = 'strict') -> None:
|
||||
def __init__(self, errors: str = ...) -> None:
|
||||
IncrementalEncoder.__init__(self, errors)
|
||||
self.buffer = ''
|
||||
@abstractmethod
|
||||
def _buffer_encode(self, input: _decoded, errors: str, final: bool) -> _encoded:
|
||||
...
|
||||
def encode(self, input: _decoded, final: bool = False) -> _encoded:
|
||||
def encode(self, input: _decoded, final: bool = ...) -> _encoded:
|
||||
...
|
||||
class BufferedIncrementalDecoder(IncrementalDecoder):
|
||||
def __init__(self, errors: str = 'strict') -> None:
|
||||
def __init__(self, errors: str = ...) -> None:
|
||||
IncrementalDecoder.__init__(self, errors)
|
||||
self.buffer = b''
|
||||
@abstractmethod
|
||||
def _buffer_decode(self, input: _encoded, errors: str, final: bool) -> Tuple[_decoded, int]:
|
||||
...
|
||||
def decode(self, object: _encoded, final: bool = False) -> _decoded:
|
||||
def decode(self, object: _encoded, final: bool = ...) -> _decoded:
|
||||
...
|
||||
|
||||
# TODO: it is not possible to specify the requirement that all other
|
||||
# attributes and methods are passed-through from the stream.
|
||||
class StreamWriter(Codec):
|
||||
def __init__(self, stream: BinaryIO, errors: str = 'strict') -> None:
|
||||
def __init__(self, stream: BinaryIO, errors: str = ...) -> None:
|
||||
self.errors = errors
|
||||
def write(self, obj: _decoded) -> None:
|
||||
...
|
||||
@@ -174,21 +174,21 @@ class StreamWriter(Codec):
|
||||
...
|
||||
|
||||
class StreamReader(Codec):
|
||||
def __init__(self, stream: BinaryIO, errors: str = 'strict') -> None:
|
||||
def __init__(self, stream: BinaryIO, errors: str = ...) -> None:
|
||||
self.errors = errors
|
||||
def read(self, size: int = -1, chars: int = -1, firstline: bool = False) -> _decoded:
|
||||
def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> _decoded:
|
||||
...
|
||||
def readline(self, size: int = -1, keepends: bool = True) -> _decoded:
|
||||
def readline(self, size: int = ..., keepends: bool = ...) -> _decoded:
|
||||
...
|
||||
def readlines(self, sizehint: int = -1, keepends: bool = True) -> List[_decoded]:
|
||||
def readlines(self, sizehint: int = ..., keepends: bool = ...) -> List[_decoded]:
|
||||
...
|
||||
def reset(self) -> None:
|
||||
...
|
||||
|
||||
class StreamReaderWriter:
|
||||
def __init__(self, stream: BinaryIO, Reader: _stream_reader_type, Writer: _stream_writer_type, errors: str = 'strict') -> None:
|
||||
def __init__(self, stream: BinaryIO, Reader: _stream_reader_type, Writer: _stream_writer_type, errors: str = ...) -> None:
|
||||
...
|
||||
|
||||
class StreamRecoder(BinaryIO):
|
||||
def __init__(self, stream: BinaryIO, encode: _encode_type, decode: _decode_type, Reader: _stream_reader_type, Writer: _stream_writer_type, errors: str = 'strict') -> None:
|
||||
def __init__(self, stream: BinaryIO, encode: _encode_type, decode: _decode_type, Reader: _stream_reader_type, Writer: _stream_writer_type, errors: str = ...) -> None:
|
||||
...
|
||||
|
||||
@@ -32,8 +32,8 @@ namedtuple = object()
|
||||
|
||||
class deque(Sized, Iterable[_T], Generic[_T]):
|
||||
maxlen = 0 # type: Optional[int] # TODO readonly
|
||||
def __init__(self, iterable: Iterable[_T] = None,
|
||||
maxlen: int = None) -> None: ...
|
||||
def __init__(self, iterable: Iterable[_T] = ...,
|
||||
maxlen: int = ...) -> None: ...
|
||||
def append(self, x: _T) -> None: ...
|
||||
def appendleft(self, x: _T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
@@ -89,8 +89,8 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
Iterable[_T]]) -> None: ...
|
||||
|
||||
class OrderedDict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
def popitem(self, last: bool = True) -> Tuple[_KT, _VT]: ...
|
||||
def move_to_end(self, key: _KT, last: bool = True) -> None: ...
|
||||
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
|
||||
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
|
||||
|
||||
|
||||
class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
|
||||
@@ -55,7 +55,7 @@ class DictReader:
|
||||
dialect = ... # type: Any
|
||||
line_num = ... # type: Any
|
||||
fieldnames = ... # type: Any # Actually a property
|
||||
def __init__(self, f, fieldnames=None, restkey=None, restval=None, dialect='',
|
||||
def __init__(self, f, fieldnames=..., restkey=..., restval=..., dialect=...,
|
||||
*args, **kwds): ...
|
||||
def __iter__(self): ...
|
||||
def __next__(self): ...
|
||||
@@ -65,7 +65,7 @@ class DictWriter:
|
||||
restval = ... # type: Any
|
||||
extrasaction = ... # type: Any
|
||||
writer = ... # type: Any
|
||||
def __init__(self, f, fieldnames, restval='', extrasaction='', dialect='', *args, **kwds) -> None: ...
|
||||
def __init__(self, f, fieldnames, restval=..., extrasaction=..., dialect=..., *args, **kwds) -> None: ...
|
||||
def writeheader(self): ...
|
||||
def writerow(self, rowdict): ...
|
||||
def writerows(self, rowdicts): ...
|
||||
@@ -73,5 +73,5 @@ class DictWriter:
|
||||
class Sniffer:
|
||||
preferred = ... # type: Any
|
||||
def __init__(self) -> None: ...
|
||||
def sniff(self, sample, delimiters=None): ...
|
||||
def sniff(self, sample, delimiters=...): ...
|
||||
def has_header(self, sample): ...
|
||||
|
||||
@@ -25,7 +25,7 @@ ROUND_HALF_UP = ... # type: str
|
||||
ROUND_UP = ... # type: str
|
||||
|
||||
def getcontext() -> Context: ...
|
||||
def localcontext(ctx: Context = None) -> _ContextManager: ...
|
||||
def localcontext(ctx: Context = ...) -> _ContextManager: ...
|
||||
def setcontext(c: Context) -> None: ...
|
||||
|
||||
DecimalTuple = NamedTuple('DecimalTuple',
|
||||
@@ -45,9 +45,9 @@ class Context:
|
||||
prec = ... # type: int
|
||||
rounding = ... # type: str
|
||||
traps = ... # type: Dict[type, bool]
|
||||
def __init__(self, prec: int = None, rounding: str = None, Emin: int = None, Emax: int = None,
|
||||
capitals: int = None, clamp: int = None, flags=None, traps=None,
|
||||
_ignored_flags=None) -> None: ...
|
||||
def __init__(self, prec: int = ..., rounding: str = ..., Emin: int = ..., Emax: int = ...,
|
||||
capitals: int = ..., clamp: int = ..., flags=..., traps=...,
|
||||
_ignored_flags=...) -> None: ...
|
||||
def Etiny(self): ...
|
||||
def Etop(self): ...
|
||||
def abs(self, x: _Decimal) -> Decimal: ...
|
||||
@@ -126,8 +126,8 @@ class Decimal(SupportsInt, SupportsFloat, SupportsAbs[Decimal], SupportsRound[in
|
||||
# TODO: SupportsCeil, SupportsFloor, SupportsTrunc?
|
||||
|
||||
def __init__(cls, value: Union[_Decimal, float, str,
|
||||
Tuple[int, Sequence[int], int]] = '',
|
||||
context: Context = None) -> None: ...
|
||||
Tuple[int, Sequence[int], int]] = ...,
|
||||
context: Context = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def imag(self) -> Decimal: ...
|
||||
@@ -137,57 +137,57 @@ class Decimal(SupportsInt, SupportsFloat, SupportsAbs[Decimal], SupportsRound[in
|
||||
def adjusted(self) -> int: ...
|
||||
def as_tuple(self) -> DecimalTuple: ...
|
||||
def canonical(self) -> Decimal: ...
|
||||
def compare(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def compare_signal(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def compare_total(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def compare_total_mag(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def compare(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def compare_signal(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def compare_total(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def compare_total_mag(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def conjugate(self) -> Decimal: ...
|
||||
def copy_abs(self) -> Decimal: ...
|
||||
def copy_negate(self) -> Decimal: ...
|
||||
def copy_sign(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def exp(self, context: Context = None) -> Decimal: ...
|
||||
def fma(self, other: _Decimal, third: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def copy_sign(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def exp(self, context: Context = ...) -> Decimal: ...
|
||||
def fma(self, other: _Decimal, third: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
@classmethod
|
||||
def from_float(cls, f: float) -> Decimal: ...
|
||||
def is_canonical(self) -> bool: ...
|
||||
def is_finite(self) -> bool: ...
|
||||
def is_infinite(self) -> bool: ...
|
||||
def is_nan(self) -> bool: ...
|
||||
def is_normal(self, context: Context = None) -> bool: ...
|
||||
def is_normal(self, context: Context = ...) -> bool: ...
|
||||
def is_qnan(self) -> bool: ...
|
||||
def is_signed(self) -> bool: ...
|
||||
def is_snan(self) -> bool: ...
|
||||
def is_subnormal(self, context: Context = None) -> bool: ...
|
||||
def is_subnormal(self, context: Context = ...) -> bool: ...
|
||||
def is_zero(self) -> bool: ...
|
||||
def ln(self, context: Context = None) -> Decimal: ...
|
||||
def log10(self, context: Context = None) -> Decimal: ...
|
||||
def logb(self, context: Context = None) -> Decimal: ...
|
||||
def logical_and(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def logical_invert(self, context: Context = None) -> Decimal: ...
|
||||
def logical_or(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def logical_xor(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def max(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def max_mag(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def min(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def min_mag(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def next_minus(self, context: Context = None) -> Decimal: ...
|
||||
def next_plus(self, context: Context = None) -> Decimal: ...
|
||||
def next_toward(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def normalize(self, context: Context = None) -> Decimal: ...
|
||||
def number_class(self, context: Context = None) -> str: ...
|
||||
def quantize(self, exp: _Decimal, rounding: str = None,
|
||||
context: Context = None) -> Decimal: ...
|
||||
def ln(self, context: Context = ...) -> Decimal: ...
|
||||
def log10(self, context: Context = ...) -> Decimal: ...
|
||||
def logb(self, context: Context = ...) -> Decimal: ...
|
||||
def logical_and(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def logical_invert(self, context: Context = ...) -> Decimal: ...
|
||||
def logical_or(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def logical_xor(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def max(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def max_mag(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def min(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def min_mag(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def next_minus(self, context: Context = ...) -> Decimal: ...
|
||||
def next_plus(self, context: Context = ...) -> Decimal: ...
|
||||
def next_toward(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def normalize(self, context: Context = ...) -> Decimal: ...
|
||||
def number_class(self, context: Context = ...) -> str: ...
|
||||
def quantize(self, exp: _Decimal, rounding: str = ...,
|
||||
context: Context = ...) -> Decimal: ...
|
||||
def radix(self) -> Decimal: ...
|
||||
def remainder_near(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def rotate(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def same_quantum(self, other: _Decimal, context: Context = None) -> bool: ...
|
||||
def scaleb(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def shift(self, other: _Decimal, context: Context = None) -> Decimal: ...
|
||||
def sqrt(self, context: Context = None) -> Decimal: ...
|
||||
def to_eng_string(self, context: Context = None) -> str: ...
|
||||
def to_integral(self, rounding: str = None, context: Context = None) -> Decimal: ...
|
||||
def to_integral_exact(self, rounding: str = None, context: Context = None) -> Decimal: ...
|
||||
def to_integral_value(self, rounding: str = None, context: Context = None) -> Decimal: ...
|
||||
def remainder_near(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def rotate(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def same_quantum(self, other: _Decimal, context: Context = ...) -> bool: ...
|
||||
def scaleb(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def shift(self, other: _Decimal, context: Context = ...) -> Decimal: ...
|
||||
def sqrt(self, context: Context = ...) -> Decimal: ...
|
||||
def to_eng_string(self, context: Context = ...) -> str: ...
|
||||
def to_integral(self, rounding: str = ..., context: Context = ...) -> Decimal: ...
|
||||
def to_integral_exact(self, rounding: str = ..., context: Context = ...) -> Decimal: ...
|
||||
def to_integral_value(self, rounding: str = ..., context: Context = ...) -> Decimal: ...
|
||||
def __abs__(self) -> Decimal: ...
|
||||
def __add__(self, other: _Decimal) -> Decimal: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
@@ -200,7 +200,7 @@ class Decimal(SupportsInt, SupportsFloat, SupportsAbs[Decimal], SupportsRound[in
|
||||
def __float__(self) -> float: ...
|
||||
def __floor__(self) -> int: ...
|
||||
def __floordiv__(self, other: _Decimal) -> Decimal: ...
|
||||
def __format__(self, specifier, context=None, _localeconv=None) -> str: ...
|
||||
def __format__(self, specifier, context=..., _localeconv=...) -> str: ...
|
||||
def __ge__(self, other: _Decimal) -> bool: ...
|
||||
def __gt__(self, other: _Decimal) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@@ -219,7 +219,7 @@ class Decimal(SupportsInt, SupportsFloat, SupportsAbs[Decimal], SupportsRound[in
|
||||
def __rfloordiv__(self, other: int) -> Decimal: ...
|
||||
def __rmod__(self, other: int) -> Decimal: ...
|
||||
def __rmul__(self, other: int) -> Decimal: ...
|
||||
def __round__(self, n=None) -> int: ...
|
||||
def __round__(self, n=...) -> int: ...
|
||||
def __rpow__(self, other: int) -> Decimal: ...
|
||||
def __rsub__(self, other: int) -> Decimal: ...
|
||||
def __rtruediv__(self, other: int) -> Decimal: ...
|
||||
|
||||
@@ -9,9 +9,9 @@ from typing import (
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class SequenceMatcher(Generic[_T]):
|
||||
def __init__(self, isjunk: Callable[[_T], bool] = None,
|
||||
def __init__(self, isjunk: Callable[[_T], bool] = ...,
|
||||
a: Sequence[_T] = ..., b: Sequence[_T] = ...,
|
||||
autojunk: bool = True) -> None: ...
|
||||
autojunk: bool = ...) -> None: ...
|
||||
def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ...
|
||||
def set_seq1(self, a: Sequence[_T]) -> None: ...
|
||||
def set_seq2(self, b: Sequence[_T]) -> None: ...
|
||||
@@ -19,43 +19,43 @@ class SequenceMatcher(Generic[_T]):
|
||||
bhi: int) -> Tuple[int, int, int]: ...
|
||||
def get_matching_blocks(self) -> List[Tuple[int, int, int]]: ...
|
||||
def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ...
|
||||
def get_grouped_opcodes(self, n: int = 3
|
||||
def get_grouped_opcodes(self, n: int = ...
|
||||
) -> Iterable[Tuple[str, int, int, int, int]]: ...
|
||||
def ratio(self) -> float: ...
|
||||
def quick_ratio(self) -> float: ...
|
||||
def real_quick_ratio(self) -> float: ...
|
||||
|
||||
def get_close_matches(word: Sequence[_T], possibilities: List[Sequence[_T]],
|
||||
n: int = 3, cutoff: float = 0.6) -> List[Sequence[_T]]: ...
|
||||
n: int = ..., cutoff: float = ...) -> List[Sequence[_T]]: ...
|
||||
|
||||
class Differ:
|
||||
def __init__(self, linejunk: Callable[[str], bool] = None,
|
||||
charjunk: Callable[[str], bool] = None) -> None: ...
|
||||
def __init__(self, linejunk: Callable[[str], bool] = ...,
|
||||
charjunk: Callable[[str], bool] = ...) -> None: ...
|
||||
def compare(self, a: Sequence[str], b: Sequence[str]) -> Iterable[str]: ...
|
||||
|
||||
def IS_LINE_JUNK(str) -> bool: ...
|
||||
def IS_CHARACTER_JUNK(str) -> bool: ...
|
||||
def unified_diff(a: Sequence[str], b: Sequence[str], fromfile: str = '',
|
||||
tofile: str = '', fromfiledate: str = '', tofiledate: str = '',
|
||||
n: int = 3, lineterm: str = '\n') -> Iterable[str]: ...
|
||||
def context_diff(a: Sequence[str], b: Sequence[str], fromfile: str='',
|
||||
tofile: str = '', fromfiledate: str = '', tofiledate: str = '',
|
||||
n: int = 3, lineterm: str = '\n') -> Iterable[str]: ...
|
||||
def unified_diff(a: Sequence[str], b: Sequence[str], fromfile: str = ...,
|
||||
tofile: str = ..., fromfiledate: str = ..., tofiledate: str = ...,
|
||||
n: int = ..., lineterm: str = ...) -> Iterable[str]: ...
|
||||
def context_diff(a: Sequence[str], b: Sequence[str], fromfile: str=...,
|
||||
tofile: str = ..., fromfiledate: str = ..., tofiledate: str = ...,
|
||||
n: int = ..., lineterm: str = ...) -> Iterable[str]: ...
|
||||
def ndiff(a: Sequence[str], b: Sequence[str],
|
||||
linejunk: Callable[[str], bool] = None,
|
||||
charjunk: Callable[[str], bool] = IS_CHARACTER_JUNK
|
||||
linejunk: Callable[[str], bool] = ...,
|
||||
charjunk: Callable[[str], bool] = ...
|
||||
) -> Iterable[str]: ...
|
||||
|
||||
class HtmlDiff(object):
|
||||
def __init__(self, tabsize: int = 8, wrapcolumn: int = None,
|
||||
linejunk: Callable[[str], bool] = None,
|
||||
charjunk: Callable[[str], bool] = IS_CHARACTER_JUNK
|
||||
def __init__(self, tabsize: int = ..., wrapcolumn: int = ...,
|
||||
linejunk: Callable[[str], bool] = ...,
|
||||
charjunk: Callable[[str], bool] = ...
|
||||
) -> None: ...
|
||||
def make_file(self, fromlines: Sequence[str], tolines: Sequence[str],
|
||||
fromdesc: str = '', todesc: str = '', context: bool = False,
|
||||
numlines: int = 5) -> str: ...
|
||||
fromdesc: str = ..., todesc: str = ..., context: bool = ...,
|
||||
numlines: int = ...) -> str: ...
|
||||
def make_table(self, fromlines: Sequence[str], tolines: Sequence[str],
|
||||
fromdesc: str = '', todesc: str = '', context: bool = False,
|
||||
numlines: int = 5) -> str: ...
|
||||
fromdesc: str = ..., todesc: str = ..., context: bool = ...,
|
||||
numlines: int = ...) -> str: ...
|
||||
|
||||
def restore(delta: Iterable[str], which: int) -> Iterable[int]: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import List
|
||||
|
||||
# In Python, arguments have integer default values
|
||||
def spawn(cmd: List[str], search_path: bool = True, verbose: bool = False,
|
||||
dry_run: bool = False) -> None: ...
|
||||
def find_executable(executable: str, path: str = None) -> str: ...
|
||||
def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ...,
|
||||
dry_run: bool = ...) -> None: ...
|
||||
def find_executable(executable: str, path: str = ...) -> str: ...
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
from typing import Any, Tuple
|
||||
|
||||
# TODO arguments missing
|
||||
def testmod(module: Any = None, *, name: str = None, globs: Any = None,
|
||||
verbose: bool = None) -> Tuple[int, int]: ...
|
||||
def testmod(module: Any = ..., *, name: str = ..., globs: Any = ...,
|
||||
verbose: bool = ...) -> Tuple[int, int]: ...
|
||||
|
||||
@@ -30,7 +30,7 @@ class _Folded:
|
||||
def newline(self): ...
|
||||
def finalize(self): ...
|
||||
def append(self, stoken): ...
|
||||
def append_if_fits(self, token, stoken=None): ...
|
||||
def append_if_fits(self, token, stoken=...): ...
|
||||
|
||||
class TokenList(list):
|
||||
token_type = ... # type: Any
|
||||
@@ -53,8 +53,8 @@ class TokenList(list):
|
||||
def fold(self, policy): ...
|
||||
def as_encoded_word(self, charset): ...
|
||||
def cte_encode(self, charset, policy): ...
|
||||
def pprint(self, indent=''): ...
|
||||
def ppstr(self, indent=''): ...
|
||||
def pprint(self, indent=...): ...
|
||||
def ppstr(self, indent=...): ...
|
||||
|
||||
class WhiteSpaceTokenList(TokenList):
|
||||
@property
|
||||
|
||||
@@ -26,11 +26,11 @@ class AddrlistClass:
|
||||
def getrouteaddr(self): ...
|
||||
def getaddrspec(self): ...
|
||||
def getdomain(self): ...
|
||||
def getdelimited(self, beginchar, endchars, allowcomments=True): ...
|
||||
def getdelimited(self, beginchar, endchars, allowcomments=...): ...
|
||||
def getquote(self): ...
|
||||
def getcomment(self): ...
|
||||
def getdomainliteral(self): ...
|
||||
def getatom(self, atomends=None): ...
|
||||
def getatom(self, atomends=...): ...
|
||||
def getphraselist(self): ...
|
||||
|
||||
class AddressList(AddrlistClass):
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
from typing import Any
|
||||
|
||||
def header_length(bytearray): ...
|
||||
def header_encode(header_bytes, charset=''): ...
|
||||
def body_encode(s, maxlinelen=76, eol=...): ...
|
||||
def header_encode(header_bytes, charset=...): ...
|
||||
def body_encode(s, maxlinelen=..., eol=...): ...
|
||||
def decode(string): ...
|
||||
|
||||
body_decode = ... # type: Any
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
from typing import Any
|
||||
|
||||
def add_charset(charset, header_enc=None, body_enc=None, output_charset=None): ...
|
||||
def add_charset(charset, header_enc=..., body_enc=..., output_charset=...): ...
|
||||
def add_alias(alias, canonical): ...
|
||||
def add_codec(charset, codecname): ...
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ class ContentManager:
|
||||
|
||||
raw_data_manager = ... # type: Any
|
||||
|
||||
def get_text_content(msg, errors=''): ...
|
||||
def get_text_content(msg, errors=...): ...
|
||||
def get_non_text_content(msg): ...
|
||||
def get_message_content(msg): ...
|
||||
def get_and_fixup_unknown_message_content(msg): ...
|
||||
def set_text_content(msg, string, subtype='', charset='', cte=None, disposition=None,
|
||||
filename=None, cid=None, params=None, headers=None): ...
|
||||
def set_message_content(msg, message, subtype='', cte=None, disposition=None, filename=None,
|
||||
cid=None, params=None, headers=None): ...
|
||||
def set_bytes_content(msg, data, maintype, subtype, cte='', disposition=None, filename=None,
|
||||
cid=None, params=None, headers=None): ...
|
||||
def set_text_content(msg, string, subtype=..., charset=..., cte=..., disposition=...,
|
||||
filename=..., cid=..., params=..., headers=...): ...
|
||||
def set_message_content(msg, message, subtype=..., cte=..., disposition=..., filename=...,
|
||||
cid=..., params=..., headers=...): ...
|
||||
def set_bytes_content(msg, data, maintype, subtype, cte=..., disposition=..., filename=...,
|
||||
cid=..., params=..., headers=...): ...
|
||||
|
||||
@@ -13,7 +13,7 @@ class CharsetError(MessageError): ...
|
||||
|
||||
class MessageDefect(ValueError):
|
||||
line = ... # type: Any
|
||||
def __init__(self, line=None) -> None: ...
|
||||
def __init__(self, line=...) -> None: ...
|
||||
|
||||
class NoBoundaryInMultipartDefect(MessageDefect): ...
|
||||
class StartBoundaryNotFoundDefect(MessageDefect): ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class BufferedSubFile:
|
||||
|
||||
class FeedParser:
|
||||
policy = ... # type: Any
|
||||
def __init__(self, _factory=None, *, policy=...) -> None: ...
|
||||
def __init__(self, _factory=..., *, policy=...) -> None: ...
|
||||
def feed(self, data): ...
|
||||
def close(self): ...
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ from typing import Any
|
||||
class Generator:
|
||||
maxheaderlen = ... # type: Any
|
||||
policy = ... # type: Any
|
||||
def __init__(self, outfp, mangle_from_=True, maxheaderlen=None, *, policy=None) -> None: ...
|
||||
def __init__(self, outfp, mangle_from_=..., maxheaderlen=..., *, policy=...) -> None: ...
|
||||
def write(self, s): ...
|
||||
def flatten(self, msg, unixfrom=False, linesep=None): ...
|
||||
def flatten(self, msg, unixfrom=..., linesep=...): ...
|
||||
def clone(self, fp): ...
|
||||
|
||||
class BytesGenerator(Generator):
|
||||
def write(self, s): ...
|
||||
|
||||
class DecodedGenerator(Generator):
|
||||
def __init__(self, outfp, mangle_from_=True, maxheaderlen=78, fmt=None) -> None: ...
|
||||
def __init__(self, outfp, mangle_from_=..., maxheaderlen=..., fmt=...) -> None: ...
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
def decode_header(header): ...
|
||||
def make_header(decoded_seq, maxlinelen=None, header_name=None, continuation_ws=''): ...
|
||||
def make_header(decoded_seq, maxlinelen=..., header_name=..., continuation_ws=...): ...
|
||||
|
||||
class Header:
|
||||
def __init__(self, s=None, charset=None, maxlinelen=None, header_name=None,
|
||||
continuation_ws='', errors=''): ...
|
||||
def __init__(self, s=..., charset=..., maxlinelen=..., header_name=...,
|
||||
continuation_ws=..., errors=...): ...
|
||||
def __eq__(self, other): ...
|
||||
def __ne__(self, other): ...
|
||||
def append(self, s, charset=None, errors=''): ...
|
||||
def encode(self, splitchars='', maxlinelen=None, linesep=''): ...
|
||||
def append(self, s, charset=..., errors=...): ...
|
||||
def encode(self, splitchars=..., maxlinelen=..., linesep=...): ...
|
||||
|
||||
class _ValueFormatter:
|
||||
def __init__(self, headerlen, maxlen, continuation_ws, splitchars) -> None: ...
|
||||
@@ -20,10 +20,10 @@ class _ValueFormatter:
|
||||
def feed(self, fws, string, charset): ...
|
||||
|
||||
class _Accumulator(list):
|
||||
def __init__(self, initial_size=0) -> None: ...
|
||||
def __init__(self, initial_size=...) -> None: ...
|
||||
def push(self, fws, string): ...
|
||||
def pop_from(self, i=0): ...
|
||||
def pop_from(self, i=...): ...
|
||||
def __len__(self): ...
|
||||
def reset(self, startval=None): ...
|
||||
def reset(self, startval=...): ...
|
||||
def is_onlyws(self): ...
|
||||
def part_count(self): ...
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
from typing import Any
|
||||
|
||||
class Address:
|
||||
def __init__(self, display_name='', username='', domain='', addr_spec=None) -> None: ...
|
||||
def __init__(self, display_name=..., username=..., domain=..., addr_spec=...) -> None: ...
|
||||
@property
|
||||
def display_name(self): ...
|
||||
@property
|
||||
@@ -17,7 +17,7 @@ class Address:
|
||||
def __eq__(self, other): ...
|
||||
|
||||
class Group:
|
||||
def __init__(self, display_name=None, addresses=None) -> None: ...
|
||||
def __init__(self, display_name=..., addresses=...) -> None: ...
|
||||
@property
|
||||
def display_name(self): ...
|
||||
@property
|
||||
@@ -127,7 +127,7 @@ class HeaderRegistry:
|
||||
registry = ... # type: Any
|
||||
base_class = ... # type: Any
|
||||
default_class = ... # type: Any
|
||||
def __init__(self, base_class=..., default_class=..., use_default_map=True) -> None: ...
|
||||
def __init__(self, base_class=..., default_class=..., use_default_map=...) -> None: ...
|
||||
def map_to_type(self, name, cls): ...
|
||||
def __getitem__(self, name): ...
|
||||
def __call__(self, name, value): ...
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
def walk(self): ...
|
||||
def body_line_iterator(msg, decode=False): ...
|
||||
def typed_subpart_iterator(msg, maintype='', subtype=None): ...
|
||||
def body_line_iterator(msg, decode=...): ...
|
||||
def typed_subpart_iterator(msg, maintype=..., subtype=...): ...
|
||||
|
||||
@@ -9,15 +9,15 @@ class Message:
|
||||
preamble = ... # type: Any
|
||||
defects = ... # type: Any
|
||||
def __init__(self, policy=...) -> None: ...
|
||||
def as_string(self, unixfrom=False, maxheaderlen=0, policy=None): ...
|
||||
def as_string(self, unixfrom=..., maxheaderlen=..., policy=...): ...
|
||||
def __bytes__(self): ...
|
||||
def as_bytes(self, unixfrom=False, policy=None): ...
|
||||
def as_bytes(self, unixfrom=..., policy=...): ...
|
||||
def is_multipart(self): ...
|
||||
def set_unixfrom(self, unixfrom): ...
|
||||
def get_unixfrom(self): ...
|
||||
def attach(self, payload): ...
|
||||
def get_payload(self, i=None, decode=False): ...
|
||||
def set_payload(self, payload, charset=None): ...
|
||||
def get_payload(self, i=..., decode=...): ...
|
||||
def set_payload(self, payload, charset=...): ...
|
||||
def set_charset(self, charset): ...
|
||||
def get_charset(self): ...
|
||||
def __len__(self): ...
|
||||
@@ -29,10 +29,10 @@ class Message:
|
||||
def keys(self): ...
|
||||
def values(self): ...
|
||||
def items(self): ...
|
||||
def get(self, name, failobj=None): ...
|
||||
def get(self, name, failobj=...): ...
|
||||
def set_raw(self, name, value): ...
|
||||
def raw_items(self): ...
|
||||
def get_all(self, name, failobj=None): ...
|
||||
def get_all(self, name, failobj=...): ...
|
||||
def add_header(self, _name, _value, **_params): ...
|
||||
def replace_header(self, _name, _value): ...
|
||||
def get_content_type(self): ...
|
||||
@@ -40,30 +40,30 @@ class Message:
|
||||
def get_content_subtype(self): ...
|
||||
def get_default_type(self): ...
|
||||
def set_default_type(self, ctype): ...
|
||||
def get_params(self, failobj=None, header='', unquote=True): ...
|
||||
def get_param(self, param, failobj=None, header='', unquote=True): ...
|
||||
def set_param(self, param, value, header='', requote=True, charset=None, language='',
|
||||
replace=False): ...
|
||||
def del_param(self, param, header='', requote=True): ...
|
||||
def set_type(self, type, header='', requote=True): ...
|
||||
def get_filename(self, failobj=None): ...
|
||||
def get_boundary(self, failobj=None): ...
|
||||
def get_params(self, failobj=..., header=..., unquote=...): ...
|
||||
def get_param(self, param, failobj=..., header=..., unquote=...): ...
|
||||
def set_param(self, param, value, header=..., requote=..., charset=..., language=...,
|
||||
replace=...): ...
|
||||
def del_param(self, param, header=..., requote=...): ...
|
||||
def set_type(self, type, header=..., requote=...): ...
|
||||
def get_filename(self, failobj=...): ...
|
||||
def get_boundary(self, failobj=...): ...
|
||||
def set_boundary(self, boundary): ...
|
||||
def get_content_charset(self, failobj=None): ...
|
||||
def get_charsets(self, failobj=None): ...
|
||||
def get_content_charset(self, failobj=...): ...
|
||||
def get_charsets(self, failobj=...): ...
|
||||
|
||||
class MIMEPart(Message):
|
||||
def __init__(self, policy=None) -> None: ...
|
||||
def __init__(self, policy=...) -> None: ...
|
||||
@property
|
||||
def is_attachment(self): ...
|
||||
def get_body(self, preferencelist=...): ...
|
||||
def iter_attachments(self): ...
|
||||
def iter_parts(self): ...
|
||||
def get_content(self, *args, content_manager=None, **kw): ...
|
||||
def set_content(self, *args, content_manager=None, **kw): ...
|
||||
def make_related(self, boundary=None): ...
|
||||
def make_alternative(self, boundary=None): ...
|
||||
def make_mixed(self, boundary=None): ...
|
||||
def get_content(self, *args, content_manager=..., **kw): ...
|
||||
def set_content(self, *args, content_manager=..., **kw): ...
|
||||
def make_related(self, boundary=...): ...
|
||||
def make_alternative(self, boundary=...): ...
|
||||
def make_mixed(self, boundary=...): ...
|
||||
def add_related(self, *args, **kw): ...
|
||||
def add_alternative(self, *args, **kw): ...
|
||||
def add_attachment(self, *args, **kw): ...
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
|
||||
class MIMEApplication(MIMENonMultipart):
|
||||
def __init__(self, _data, _subtype='', _encoder=..., **_params) -> None: ...
|
||||
def __init__(self, _data, _subtype=..., _encoder=..., **_params) -> None: ...
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
|
||||
class MIMEAudio(MIMENonMultipart):
|
||||
def __init__(self, _audiodata, _subtype=None, _encoder=..., **_params) -> None: ...
|
||||
def __init__(self, _audiodata, _subtype=..., _encoder=..., **_params) -> None: ...
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
|
||||
class MIMEImage(MIMENonMultipart):
|
||||
def __init__(self, _imagedata, _subtype=None, _encoder=..., **_params) -> None: ...
|
||||
def __init__(self, _imagedata, _subtype=..., _encoder=..., **_params) -> None: ...
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
|
||||
class MIMEMessage(MIMENonMultipart):
|
||||
def __init__(self, _msg, _subtype='') -> None: ...
|
||||
def __init__(self, _msg, _subtype=...) -> None: ...
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
from email.mime.base import MIMEBase
|
||||
|
||||
class MIMEMultipart(MIMEBase):
|
||||
def __init__(self, _subtype='', boundary=None, _subparts=None, **_params) -> None: ...
|
||||
def __init__(self, _subtype=..., boundary=..., _subparts=..., **_params) -> None: ...
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
|
||||
class MIMEText(MIMENonMultipart):
|
||||
def __init__(self, _text, _subtype='', _charset=None) -> None: ...
|
||||
def __init__(self, _text, _subtype=..., _charset=...) -> None: ...
|
||||
|
||||
@@ -10,20 +10,20 @@ BytesFeedParser = email.feedparser.BytesFeedParser
|
||||
|
||||
class Parser:
|
||||
policy = ... # type: Any
|
||||
def __init__(self, _class=None, *, policy=...) -> None: ...
|
||||
def parse(self, fp, headersonly=False): ...
|
||||
def parsestr(self, text, headersonly=False): ...
|
||||
def __init__(self, _class=..., *, policy=...) -> None: ...
|
||||
def parse(self, fp, headersonly=...): ...
|
||||
def parsestr(self, text, headersonly=...): ...
|
||||
|
||||
class HeaderParser(Parser):
|
||||
def parse(self, fp, headersonly=True): ...
|
||||
def parsestr(self, text, headersonly=True): ...
|
||||
def parse(self, fp, headersonly=...): ...
|
||||
def parsestr(self, text, headersonly=...): ...
|
||||
|
||||
class BytesParser:
|
||||
parser = ... # type: Any
|
||||
def __init__(self, *args, **kw) -> None: ...
|
||||
def parse(self, fp, headersonly=False): ...
|
||||
def parsebytes(self, text, headersonly=False): ...
|
||||
def parse(self, fp, headersonly=...): ...
|
||||
def parsebytes(self, text, headersonly=...): ...
|
||||
|
||||
class BytesHeaderParser(BytesParser):
|
||||
def parse(self, fp, headersonly=True): ...
|
||||
def parsebytes(self, text, headersonly=True): ...
|
||||
def parse(self, fp, headersonly=...): ...
|
||||
def parsebytes(self, text, headersonly=...): ...
|
||||
|
||||
@@ -8,8 +8,8 @@ def header_length(bytearray): ...
|
||||
def body_length(bytearray): ...
|
||||
def unquote(s): ...
|
||||
def quote(c): ...
|
||||
def header_encode(header_bytes, charset=''): ...
|
||||
def body_encode(body, maxlinelen=76, eol=...): ...
|
||||
def header_encode(header_bytes, charset=...): ...
|
||||
def body_encode(body, maxlinelen=..., eol=...): ...
|
||||
def decode(encoded, eol=...): ...
|
||||
|
||||
body_decode = ... # type: Any
|
||||
|
||||
@@ -8,15 +8,15 @@ mktime_tz = email._parseaddr.mktime_tz
|
||||
parsedate = email._parseaddr.parsedate
|
||||
parsedate_tz = email._parseaddr.parsedate_tz
|
||||
|
||||
def formataddr(pair, charset=''): ...
|
||||
def formataddr(pair, charset=...): ...
|
||||
def getaddresses(fieldvalues): ...
|
||||
def formatdate(timeval=None, localtime=False, usegmt=False): ...
|
||||
def format_datetime(dt, usegmt=False): ...
|
||||
def make_msgid(idstring=None, domain=None): ...
|
||||
def formatdate(timeval=..., localtime=..., usegmt=...): ...
|
||||
def format_datetime(dt, usegmt=...): ...
|
||||
def make_msgid(idstring=..., domain=...): ...
|
||||
def parsedate_to_datetime(data): ...
|
||||
def parseaddr(addr): ...
|
||||
def unquote(str): ...
|
||||
def decode_rfc2231(s): ...
|
||||
def encode_rfc2231(s, charset=None, language=None): ...
|
||||
def encode_rfc2231(s, charset=..., language=...): ...
|
||||
def decode_params(params): ...
|
||||
def collapse_rfc2231_value(value, errors='', fallback_charset=''): ...
|
||||
def collapse_rfc2231_value(value, errors=..., fallback_charset=...): ...
|
||||
|
||||
@@ -10,5 +10,5 @@ class StreamReader(codecs.StreamReader):
|
||||
pass
|
||||
|
||||
def getregentry() -> codecs.CodecInfo: pass
|
||||
def encode(input: str, errors: str = 'strict') -> bytes: pass
|
||||
def decode(input: bytes, errors: str = 'strict') -> str: pass
|
||||
def encode(input: str, errors: str = ...) -> bytes: pass
|
||||
def decode(input: bytes, errors: str = ...) -> str: pass
|
||||
|
||||
@@ -6,7 +6,7 @@ from typing import Callable, Any, Optional
|
||||
|
||||
# TODO implement as class; more precise typing
|
||||
# TODO cache_info and __wrapped__ attributes
|
||||
def lru_cache(maxsize: Optional[int] = 100) -> Callable[[Any], Any]: ...
|
||||
def lru_cache(maxsize: Optional[int] = ...) -> Callable[[Any], Any]: ...
|
||||
|
||||
# TODO more precise typing?
|
||||
def wraps(func: Any) -> Any: ...
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
from typing import Any
|
||||
|
||||
class NullTranslations:
|
||||
def __init__(self, fp=None) -> None: ...
|
||||
def __init__(self, fp=...) -> None: ...
|
||||
def add_fallback(self, fallback): ...
|
||||
def gettext(self, message): ...
|
||||
def lgettext(self, message): ...
|
||||
@@ -15,7 +15,7 @@ class NullTranslations:
|
||||
def charset(self): ...
|
||||
def output_charset(self): ...
|
||||
def set_output_charset(self, charset): ...
|
||||
def install(self, names=None): ...
|
||||
def install(self, names=...): ...
|
||||
|
||||
class GNUTranslations(NullTranslations):
|
||||
LE_MAGIC = ... # type: Any
|
||||
@@ -25,12 +25,12 @@ class GNUTranslations(NullTranslations):
|
||||
def gettext(self, message): ...
|
||||
def ngettext(self, msgid1, msgid2, n): ...
|
||||
|
||||
def find(domain, localedir=None, languages=None, all=False): ...
|
||||
def translation(domain, localedir=None, languages=None, class_=None, fallback=False,
|
||||
codeset=None): ...
|
||||
def install(domain, localedir=None, codeset=None, names=None): ...
|
||||
def textdomain(domain=None): ...
|
||||
def bindtextdomain(domain, localedir=None): ...
|
||||
def find(domain, localedir=..., languages=..., all=...): ...
|
||||
def translation(domain, localedir=..., languages=..., class_=..., fallback=...,
|
||||
codeset=...): ...
|
||||
def install(domain, localedir=..., codeset=..., names=...): ...
|
||||
def textdomain(domain=...): ...
|
||||
def bindtextdomain(domain, localedir=...): ...
|
||||
def dgettext(domain, message): ...
|
||||
def dngettext(domain, msgid1, msgid2, n): ...
|
||||
def gettext(message): ...
|
||||
|
||||
@@ -15,11 +15,11 @@ class Hash(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def copy(self) -> 'Hash': ...
|
||||
|
||||
def md5(arg: bytes = None) -> Hash: ...
|
||||
def sha1(arg: bytes = None) -> Hash: ...
|
||||
def sha224(arg: bytes = None) -> Hash: ...
|
||||
def sha256(arg: bytes = None) -> Hash: ...
|
||||
def sha384(arg: bytes = None) -> Hash: ...
|
||||
def sha512(arg: bytes = None) -> Hash: ...
|
||||
def md5(arg: bytes = ...) -> Hash: ...
|
||||
def sha1(arg: bytes = ...) -> Hash: ...
|
||||
def sha224(arg: bytes = ...) -> Hash: ...
|
||||
def sha256(arg: bytes = ...) -> Hash: ...
|
||||
def sha384(arg: bytes = ...) -> Hash: ...
|
||||
def sha512(arg: bytes = ...) -> Hash: ...
|
||||
|
||||
def new(name: str, data: bytes = None) -> Hash: ...
|
||||
def new(name: str, data: bytes = ...) -> Hash: ...
|
||||
|
||||
@@ -13,6 +13,6 @@ def heapify(x: List[_T]) -> None: ...
|
||||
def heapreplace(heap: List[_T], item: _T) -> _T: ...
|
||||
def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ...
|
||||
def nlargest(n: int, iterable: Iterable[_T],
|
||||
key: Callable[[_T], Any] = None) -> List[_T]: ...
|
||||
key: Callable[[_T], Any] = ...) -> List[_T]: ...
|
||||
def nsmallest(n: int, iterable: Iterable[_T],
|
||||
key: Callable[[_T], Any] = None) -> List[_T]: ...
|
||||
key: Callable[[_T], Any] = ...) -> List[_T]: ...
|
||||
|
||||
@@ -20,17 +20,17 @@ class HTTPResponse(io.RawIOBase):
|
||||
chunk_left = ... # type: Any
|
||||
length = ... # type: Any
|
||||
will_close = ... # type: Any
|
||||
def __init__(self, sock, debuglevel=0, method=None, url=None) -> None: ...
|
||||
def __init__(self, sock, debuglevel=..., method=..., url=...) -> None: ...
|
||||
code = ... # type: Any
|
||||
def begin(self): ...
|
||||
def close(self): ...
|
||||
def flush(self): ...
|
||||
def readable(self): ...
|
||||
def isclosed(self): ...
|
||||
def read(self, amt=None): ...
|
||||
def read(self, amt=...): ...
|
||||
def readinto(self, b): ...
|
||||
def fileno(self): ...
|
||||
def getheader(self, name, default=None): ...
|
||||
def getheader(self, name, default=...): ...
|
||||
def getheaders(self): ...
|
||||
def __iter__(self): ...
|
||||
def info(self): ...
|
||||
@@ -46,24 +46,24 @@ class HTTPConnection:
|
||||
timeout = ... # type: Any
|
||||
source_address = ... # type: Any
|
||||
sock = ... # type: Any
|
||||
def __init__(self, host, port=None, timeout=..., source_address=None) -> None: ...
|
||||
def set_tunnel(self, host, port=None, headers=None): ...
|
||||
def __init__(self, host, port=..., timeout=..., source_address=...) -> None: ...
|
||||
def set_tunnel(self, host, port=..., headers=...): ...
|
||||
def set_debuglevel(self, level): ...
|
||||
def connect(self): ...
|
||||
def close(self): ...
|
||||
def send(self, data): ...
|
||||
def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): ...
|
||||
def putrequest(self, method, url, skip_host=..., skip_accept_encoding=...): ...
|
||||
def putheader(self, header, *values): ...
|
||||
def endheaders(self, message_body=None): ...
|
||||
def request(self, method, url, body=None, headers=...): ...
|
||||
def endheaders(self, message_body=...): ...
|
||||
def request(self, method, url, body=..., headers=...): ...
|
||||
def getresponse(self): ...
|
||||
|
||||
class HTTPSConnection(HTTPConnection):
|
||||
default_port = ... # type: Any
|
||||
key_file = ... # type: Any
|
||||
cert_file = ... # type: Any
|
||||
def __init__(self, host, port=None, key_file=None, cert_file=None, timeout=...,
|
||||
source_address=None, *, context=None, check_hostname=None): ...
|
||||
def __init__(self, host, port=..., key_file=..., cert_file=..., timeout=...,
|
||||
source_address=..., *, context=..., check_hostname=...): ...
|
||||
sock = ... # type: Any
|
||||
def connect(self): ...
|
||||
|
||||
@@ -83,7 +83,7 @@ class IncompleteRead(HTTPException):
|
||||
args = ... # type: Any
|
||||
partial = ... # type: Any
|
||||
expected = ... # type: Any
|
||||
def __init__(self, partial, expected=None) -> None: ...
|
||||
def __init__(self, partial, expected=...) -> None: ...
|
||||
|
||||
class ImproperConnectionState(HTTPException): ...
|
||||
class CannotSendRequest(ImproperConnectionState): ...
|
||||
|
||||
@@ -23,11 +23,11 @@ class Cookie:
|
||||
rfc2109 = ... # type: Any
|
||||
def __init__(self, version, name, value, port, port_specified, domain, domain_specified,
|
||||
domain_initial_dot, path, path_specified, secure, expires, discard, comment,
|
||||
comment_url, rest, rfc2109=False): ...
|
||||
comment_url, rest, rfc2109=...): ...
|
||||
def has_nonstandard_attr(self, name): ...
|
||||
def get_nonstandard_attr(self, name, default=None): ...
|
||||
def get_nonstandard_attr(self, name, default=...): ...
|
||||
def set_nonstandard_attr(self, name, value): ...
|
||||
def is_expired(self, now=None): ...
|
||||
def is_expired(self, now=...): ...
|
||||
|
||||
class CookiePolicy:
|
||||
def set_ok(self, cookie, request): ...
|
||||
@@ -51,11 +51,11 @@ class DefaultCookiePolicy(CookiePolicy):
|
||||
strict_ns_domain = ... # type: Any
|
||||
strict_ns_set_initial_dollar = ... # type: Any
|
||||
strict_ns_set_path = ... # type: Any
|
||||
def __init__(self, blocked_domains=None, allowed_domains=None, netscape=True, rfc2965=False,
|
||||
rfc2109_as_netscape=None, hide_cookie2=False, strict_domain=False,
|
||||
strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False,
|
||||
strict_ns_domain=..., strict_ns_set_initial_dollar=False,
|
||||
strict_ns_set_path=False): ...
|
||||
def __init__(self, blocked_domains=..., allowed_domains=..., netscape=..., rfc2965=...,
|
||||
rfc2109_as_netscape=..., hide_cookie2=..., strict_domain=...,
|
||||
strict_rfc2965_unverifiable=..., strict_ns_unverifiable=...,
|
||||
strict_ns_domain=..., strict_ns_set_initial_dollar=...,
|
||||
strict_ns_set_path=...): ...
|
||||
def blocked_domains(self): ...
|
||||
def set_blocked_domains(self, blocked_domains): ...
|
||||
def is_blocked(self, domain): ...
|
||||
@@ -88,14 +88,14 @@ class CookieJar:
|
||||
domain_re = ... # type: Any
|
||||
dots_re = ... # type: Any
|
||||
magic_re = ... # type: Any
|
||||
def __init__(self, policy=None) -> None: ...
|
||||
def __init__(self, policy=...) -> None: ...
|
||||
def set_policy(self, policy): ...
|
||||
def add_cookie_header(self, request): ...
|
||||
def make_cookies(self, response, request): ...
|
||||
def set_cookie_if_ok(self, cookie, request): ...
|
||||
def set_cookie(self, cookie): ...
|
||||
def extract_cookies(self, response, request): ...
|
||||
def clear(self, domain=None, path=None, name=None): ...
|
||||
def clear(self, domain=..., path=..., name=...): ...
|
||||
def clear_session_cookies(self): ...
|
||||
def clear_expired_cookies(self): ...
|
||||
def __iter__(self): ...
|
||||
@@ -106,16 +106,16 @@ class LoadError(OSError): ...
|
||||
class FileCookieJar(CookieJar):
|
||||
filename = ... # type: Any
|
||||
delayload = ... # type: Any
|
||||
def __init__(self, filename=None, delayload=False, policy=None) -> None: ...
|
||||
def save(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
def load(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
def revert(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
def __init__(self, filename=..., delayload=..., policy=...) -> None: ...
|
||||
def save(self, filename=..., ignore_discard=..., ignore_expires=...): ...
|
||||
def load(self, filename=..., ignore_discard=..., ignore_expires=...): ...
|
||||
def revert(self, filename=..., ignore_discard=..., ignore_expires=...): ...
|
||||
|
||||
class LWPCookieJar(FileCookieJar):
|
||||
def as_lwp_str(self, ignore_discard=True, ignore_expires=True): ...
|
||||
def save(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
def as_lwp_str(self, ignore_discard=..., ignore_expires=...): ...
|
||||
def save(self, filename=..., ignore_discard=..., ignore_expires=...): ...
|
||||
|
||||
class MozillaCookieJar(FileCookieJar):
|
||||
magic_re = ... # type: Any
|
||||
header = ... # type: Any
|
||||
def save(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
def save(self, filename=..., ignore_discard=..., ignore_expires=...): ...
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
from typing import Any
|
||||
|
||||
# TODO more precise type?
|
||||
def import_module(name: str, package: str = None) -> Any: ...
|
||||
def import_module(name: str, package: str = ...) -> Any: ...
|
||||
def invalidate_caches() -> None: ...
|
||||
|
||||
@@ -20,7 +20,7 @@ class UnsupportedOperation(ValueError, OSError): ...
|
||||
class IncrementalNewlineDecoder(codecs.IncrementalDecoder):
|
||||
newlines = ... # type: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def decode(self, input, final=False): ...
|
||||
def decode(self, input, final=...): ...
|
||||
def getstate(self): ...
|
||||
def reset(self): ...
|
||||
def setstate(self, state): ...
|
||||
@@ -42,7 +42,7 @@ class BufferedReader(_io._BufferedIOBase):
|
||||
name = ... # type: Any
|
||||
raw = ... # type: Any
|
||||
def __init__(self, raw, buffer_size=...) -> None: ...
|
||||
def peek(self, size: int = -1): ...
|
||||
def peek(self, size: int = ...): ...
|
||||
|
||||
class BufferedWriter(_io._BufferedIOBase):
|
||||
mode = ... # type: Any
|
||||
@@ -52,17 +52,17 @@ class BufferedWriter(_io._BufferedIOBase):
|
||||
|
||||
class BufferedRWPair(_io._BufferedIOBase):
|
||||
def __init__(self, reader, writer, buffer_size=...) -> None: ...
|
||||
def peek(self, size: int = -1): ...
|
||||
def peek(self, size: int = ...): ...
|
||||
|
||||
class BufferedRandom(_io._BufferedIOBase):
|
||||
mode = ... # type: Any
|
||||
name = ... # type: Any
|
||||
raw = ... # type: Any
|
||||
def __init__(self, raw, buffer_size=...) -> None: ...
|
||||
def peek(self, size: int = -1): ...
|
||||
def peek(self, size: int = ...): ...
|
||||
|
||||
class BytesIO(BinaryIO):
|
||||
def __init__(self, initial_bytes: bytes = b'') -> None: ...
|
||||
def __init__(self, initial_bytes: bytes = ...) -> None: ...
|
||||
# TODO getbuffer
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
@@ -71,14 +71,14 @@ class BytesIO(BinaryIO):
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, n: int = -1) -> bytes: ...
|
||||
def read(self, n: int = ...) -> bytes: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = -1) -> bytes: ...
|
||||
def readlines(self, hint: int = -1) -> List[bytes]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> int: ...
|
||||
def readline(self, limit: int = ...) -> bytes: ...
|
||||
def readlines(self, hint: int = ...) -> List[bytes]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
@overload
|
||||
def write(self, s: bytes) -> int: ...
|
||||
@@ -93,8 +93,8 @@ class BytesIO(BinaryIO):
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
|
||||
class StringIO(TextIO):
|
||||
def __init__(self, initial_value: str = '',
|
||||
newline: str = None) -> None: ...
|
||||
def __init__(self, initial_value: str = ...,
|
||||
newline: str = ...) -> None: ...
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
@@ -102,14 +102,14 @@ class StringIO(TextIO):
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, n: int = -1) -> str: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = -1) -> str: ...
|
||||
def readlines(self, hint: int = -1) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> int: ...
|
||||
def readline(self, limit: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
def write(self, s: str) -> int: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
@@ -122,10 +122,10 @@ class StringIO(TextIO):
|
||||
class TextIOWrapper(TextIO):
|
||||
# TODO: This is actually a base class of _io._TextIOBase.
|
||||
# write_through is undocumented but used by subprocess
|
||||
def __init__(self, buffer: IO[bytes], encoding: str = None,
|
||||
errors: str = None, newline: str = None,
|
||||
line_buffering: bool = False,
|
||||
write_through: bool = True) -> None: ...
|
||||
def __init__(self, buffer: IO[bytes], encoding: str = ...,
|
||||
errors: str = ..., newline: str = ...,
|
||||
line_buffering: bool = ...,
|
||||
write_through: bool = ...) -> None: ...
|
||||
# TODO see comments in BinaryIO for missing functionality
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
@@ -133,14 +133,14 @@ class TextIOWrapper(TextIO):
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, n: int = -1) -> str: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = -1) -> str: ...
|
||||
def readlines(self, hint: int = -1) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> int: ...
|
||||
def readline(self, limit: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
def write(self, s: str) -> int: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from typing import Any
|
||||
|
||||
def getline(filename:str, lineno:int, module_globals: Any=None) -> str: pass
|
||||
def getline(filename:str, lineno:int, module_globals: Any=...) -> str: pass
|
||||
def clearcache() -> None: pass
|
||||
def getlines(filename: str, module_globals: Any=None) -> None: pass
|
||||
def getlines(filename: str, module_globals: Any=...) -> None: pass
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
from _locale import *
|
||||
|
||||
def format(percent, value, grouping=False, monetary=False, *additional): ...
|
||||
def format_string(f, val, grouping=False): ...
|
||||
def currency(val, symbol=True, grouping=False, international=False): ...
|
||||
def format(percent, value, grouping=..., monetary=..., *additional): ...
|
||||
def format_string(f, val, grouping=...): ...
|
||||
def currency(val, symbol=..., grouping=..., international=...): ...
|
||||
def str(val): ...
|
||||
def atof(string, func=...): ...
|
||||
def atoi(str): ...
|
||||
@@ -14,4 +14,4 @@ def normalize(localename): ...
|
||||
def getdefaultlocale(envvars=...): ...
|
||||
def getlocale(category=...): ...
|
||||
def resetlocale(category=...): ...
|
||||
def getpreferredencoding(do_setlocale=True): ...
|
||||
def getpreferredencoding(do_setlocale=...): ...
|
||||
|
||||
@@ -37,7 +37,7 @@ class LogRecord:
|
||||
threadName = ... # type: Any
|
||||
processName = ... # type: Any
|
||||
process = ... # type: Any
|
||||
def __init__(self, name, level, pathname, lineno, msg, args, exc_info, func=None, sinfo=None,
|
||||
def __init__(self, name, level, pathname, lineno, msg, args, exc_info, func=..., sinfo=...,
|
||||
**kwargs): ...
|
||||
def getMessage(self): ...
|
||||
|
||||
@@ -72,10 +72,10 @@ BASIC_FORMAT = ... # type: Any
|
||||
class Formatter:
|
||||
converter = ... # type: Any
|
||||
datefmt = ... # type: Any
|
||||
def __init__(self, fmt=None, datefmt=None, style='') -> None: ...
|
||||
def __init__(self, fmt=..., datefmt=..., style=...) -> None: ...
|
||||
default_time_format = ... # type: Any
|
||||
default_msec_format = ... # type: Any
|
||||
def formatTime(self, record, datefmt=None): ...
|
||||
def formatTime(self, record, datefmt=...): ...
|
||||
def formatException(self, ei): ...
|
||||
def usesTime(self): ...
|
||||
def formatMessage(self, record): ...
|
||||
@@ -84,7 +84,7 @@ class Formatter:
|
||||
|
||||
class BufferingFormatter:
|
||||
linefmt = ... # type: Any
|
||||
def __init__(self, linefmt=None) -> None: ...
|
||||
def __init__(self, linefmt=...) -> None: ...
|
||||
def formatHeader(self, records): ...
|
||||
def formatFooter(self, records): ...
|
||||
def format(self, records): ...
|
||||
@@ -92,7 +92,7 @@ class BufferingFormatter:
|
||||
class Filter:
|
||||
name = ... # type: Any
|
||||
nlen = ... # type: Any
|
||||
def __init__(self, name='') -> None: ...
|
||||
def __init__(self, name=...) -> None: ...
|
||||
def filter(self, record): ...
|
||||
|
||||
class Filterer:
|
||||
@@ -125,7 +125,7 @@ class Handler(Filterer):
|
||||
class StreamHandler(Handler):
|
||||
terminator = ... # type: Any
|
||||
stream = ... # type: Any
|
||||
def __init__(self, stream=None) -> None: ...
|
||||
def __init__(self, stream=...) -> None: ...
|
||||
def flush(self): ...
|
||||
def emit(self, record): ...
|
||||
|
||||
@@ -135,7 +135,7 @@ class FileHandler(StreamHandler):
|
||||
encoding = ... # type: Any
|
||||
delay = ... # type: Any
|
||||
stream = ... # type: Any
|
||||
def __init__(self, filename, mode='', encoding=None, delay=False) -> None: ...
|
||||
def __init__(self, filename, mode=..., encoding=..., delay=...) -> None: ...
|
||||
def close(self): ...
|
||||
def emit(self, record): ...
|
||||
|
||||
@@ -182,9 +182,9 @@ class Logger(Filterer):
|
||||
def critical(self, msg, *args, **kwargs): ...
|
||||
fatal = ... # type: Any
|
||||
def log(self, level, msg, *args, **kwargs): ...
|
||||
def findCaller(self, stack_info=False): ...
|
||||
def makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=None, extra=None,
|
||||
sinfo=None): ...
|
||||
def findCaller(self, stack_info=...): ...
|
||||
def makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=..., extra=...,
|
||||
sinfo=...): ...
|
||||
def handle(self, record): ...
|
||||
def addHandler(self, hdlr): ...
|
||||
def removeHandler(self, hdlr): ...
|
||||
@@ -216,7 +216,7 @@ class LoggerAdapter:
|
||||
def hasHandlers(self): ...
|
||||
|
||||
def basicConfig(**kwargs): ...
|
||||
def getLogger(name=None): ...
|
||||
def getLogger(name=...): ...
|
||||
def critical(msg, *args, **kwargs): ...
|
||||
|
||||
fatal = ... # type: Any
|
||||
|
||||
@@ -18,7 +18,7 @@ class BaseRotatingHandler(logging.FileHandler):
|
||||
encoding = ... # type: Any
|
||||
namer = ... # type: Any
|
||||
rotator = ... # type: Any
|
||||
def __init__(self, filename, mode, encoding=None, delay=False) -> None: ...
|
||||
def __init__(self, filename, mode, encoding=..., delay=...) -> None: ...
|
||||
def emit(self, record): ...
|
||||
def rotation_filename(self, default_name): ...
|
||||
def rotate(self, source, dest): ...
|
||||
@@ -26,8 +26,8 @@ class BaseRotatingHandler(logging.FileHandler):
|
||||
class RotatingFileHandler(BaseRotatingHandler):
|
||||
maxBytes = ... # type: Any
|
||||
backupCount = ... # type: Any
|
||||
def __init__(self, filename, mode='', maxBytes=0, backupCount=0, encoding=None,
|
||||
delay=False): ...
|
||||
def __init__(self, filename, mode=..., maxBytes=..., backupCount=..., encoding=...,
|
||||
delay=...): ...
|
||||
stream = ... # type: Any
|
||||
def doRollover(self): ...
|
||||
def shouldRollover(self, record): ...
|
||||
@@ -42,8 +42,8 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
|
||||
extMatch = ... # type: Any
|
||||
dayOfWeek = ... # type: Any
|
||||
rolloverAt = ... # type: Any
|
||||
def __init__(self, filename, when='', interval=1, backupCount=0, encoding=None, delay=False,
|
||||
utc=False, atTime=None): ...
|
||||
def __init__(self, filename, when=..., interval=..., backupCount=..., encoding=..., delay=...,
|
||||
utc=..., atTime=...): ...
|
||||
def computeRollover(self, currentTime): ...
|
||||
def shouldRollover(self, record): ...
|
||||
def getFilesToDelete(self): ...
|
||||
@@ -51,7 +51,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
|
||||
def doRollover(self): ...
|
||||
|
||||
class WatchedFileHandler(logging.FileHandler):
|
||||
def __init__(self, filename, mode='', encoding=None, delay=False) -> None: ...
|
||||
def __init__(self, filename, mode=..., encoding=..., delay=...) -> None: ...
|
||||
stream = ... # type: Any
|
||||
def emit(self, record): ...
|
||||
|
||||
@@ -66,7 +66,7 @@ class SocketHandler(logging.Handler):
|
||||
retryMax = ... # type: Any
|
||||
retryFactor = ... # type: Any
|
||||
def __init__(self, host, port) -> None: ...
|
||||
def makeSocket(self, timeout=1): ...
|
||||
def makeSocket(self, timeout=...): ...
|
||||
retryPeriod = ... # type: Any
|
||||
def createSocket(self): ...
|
||||
def send(self, s): ...
|
||||
@@ -78,7 +78,7 @@ class SocketHandler(logging.Handler):
|
||||
class DatagramHandler(SocketHandler):
|
||||
closeOnError = ... # type: Any
|
||||
def __init__(self, host, port) -> None: ...
|
||||
def makeSocket(self, timeout=1): ... # TODO: Actually does not have the timeout argument.
|
||||
def makeSocket(self, timeout=...): ... # TODO: Actually does not have the timeout argument.
|
||||
def send(self, s): ...
|
||||
|
||||
class SysLogHandler(logging.Handler):
|
||||
@@ -119,7 +119,7 @@ class SysLogHandler(logging.Handler):
|
||||
unixsocket = ... # type: Any
|
||||
socket = ... # type: Any
|
||||
formatter = ... # type: Any
|
||||
def __init__(self, address=..., facility=..., socktype=None) -> None: ...
|
||||
def __init__(self, address=..., facility=..., socktype=...) -> None: ...
|
||||
def encodePriority(self, facility, priority): ...
|
||||
def close(self): ...
|
||||
def mapPriority(self, levelName): ...
|
||||
@@ -134,8 +134,8 @@ class SMTPHandler(logging.Handler):
|
||||
subject = ... # type: Any
|
||||
secure = ... # type: Any
|
||||
timeout = ... # type: Any
|
||||
def __init__(self, mailhost, fromaddr, toaddrs, subject, credentials=None, secure=None,
|
||||
timeout=0.0): ...
|
||||
def __init__(self, mailhost, fromaddr, toaddrs, subject, credentials=..., secure=...,
|
||||
timeout=...): ...
|
||||
def getSubject(self, record): ...
|
||||
def emit(self, record): ...
|
||||
|
||||
@@ -145,7 +145,7 @@ class NTEventLogHandler(logging.Handler):
|
||||
logtype = ... # type: Any
|
||||
deftype = ... # type: Any
|
||||
typemap = ... # type: Any
|
||||
def __init__(self, appname, dllname=None, logtype='') -> None: ...
|
||||
def __init__(self, appname, dllname=..., logtype=...) -> None: ...
|
||||
def getMessageID(self, record): ...
|
||||
def getEventCategory(self, record): ...
|
||||
def getEventType(self, record): ...
|
||||
@@ -158,7 +158,7 @@ class HTTPHandler(logging.Handler):
|
||||
method = ... # type: Any
|
||||
secure = ... # type: Any
|
||||
credentials = ... # type: Any
|
||||
def __init__(self, host, url, method='', secure=False, credentials=None) -> None: ...
|
||||
def __init__(self, host, url, method=..., secure=..., credentials=...) -> None: ...
|
||||
def mapLogRecord(self, record): ...
|
||||
def emit(self, record): ...
|
||||
|
||||
@@ -174,7 +174,7 @@ class BufferingHandler(logging.Handler):
|
||||
class MemoryHandler(BufferingHandler):
|
||||
flushLevel = ... # type: Any
|
||||
target = ... # type: Any
|
||||
def __init__(self, capacity, flushLevel=..., target=None) -> None: ...
|
||||
def __init__(self, capacity, flushLevel=..., target=...) -> None: ...
|
||||
def shouldFlush(self, record): ...
|
||||
def setTarget(self, target): ...
|
||||
buffer = ... # type: Any
|
||||
|
||||
@@ -6,7 +6,7 @@ class Lock(): ...
|
||||
class Process(): ...
|
||||
|
||||
class Queue():
|
||||
def get(block: bool = None, timeout: float = None) -> Any: ...
|
||||
def get(block: bool = ..., timeout: float = ...) -> Any: ...
|
||||
|
||||
class Value():
|
||||
def __init__(typecode_or_type: str, *args: Any, lock: bool = True) -> None: ...
|
||||
def __init__(typecode_or_type: str, *args: Any, lock: bool = ...) -> None: ...
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
from typing import Any
|
||||
|
||||
class BaseManager():
|
||||
def register(typeid: str, callable: Any = None) -> None: ...
|
||||
def register(typeid: str, callable: Any = ...) -> None: ...
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
class ThreadPool():
|
||||
def __init__(self, processes: int = None) -> None: ...
|
||||
def __init__(self, processes: int = ...) -> None: ...
|
||||
|
||||
@@ -157,7 +157,7 @@ class statvfs_result: # Unix only
|
||||
def name() -> str: ...
|
||||
def fsencode(filename: str) -> bytes: ...
|
||||
def fsdecode(filename: bytes) -> str: ...
|
||||
def get_exec_path(env=None) -> List[str] : ...
|
||||
def get_exec_path(env=...) -> List[str] : ...
|
||||
# NOTE: get_exec_path(): returns List[bytes] when env not None
|
||||
def ctermid() -> str: ... # Unix only
|
||||
def getegid() -> int: ... # Unix only
|
||||
@@ -173,8 +173,8 @@ def getppid() -> int: ...
|
||||
def getresuid() -> Tuple[int, int, int]: ... # Unix only
|
||||
def getresgid() -> Tuple[int, int, int]: ... # Unix only
|
||||
def getuid() -> int: ... # Unix only
|
||||
def getenv(key: str, default: str = None) -> str: ...
|
||||
def getenvb(key: bytes, default: bytes = None) -> bytes: ...
|
||||
def getenv(key: str, default: str = ...) -> str: ...
|
||||
def getenvb(key: bytes, default: bytes = ...) -> bytes: ...
|
||||
# TODO mixed str/bytes putenv arguments
|
||||
def putenv(key: AnyStr, value: AnyStr) -> None: ...
|
||||
def setegid(egid: int) -> None: ... # Unix only
|
||||
@@ -195,8 +195,8 @@ def umask(mask: int) -> int: ...
|
||||
def uname() -> Tuple[str, str, str, str, str]: ... # Unix only
|
||||
def unsetenv(key: AnyStr) -> None: ...
|
||||
# Return IO or TextIO
|
||||
def fdopen(fd: int, mode: str = 'r', encoding: str = None, errors: str = None,
|
||||
newline: str = None, closefd: bool = True) -> Any: ...
|
||||
def fdopen(fd: int, mode: str = ..., encoding: str = ..., errors: str = ...,
|
||||
newline: str = ..., closefd: bool = ...) -> Any: ...
|
||||
def close(fd: int) -> None: ...
|
||||
def closerange(fd_low: int, fd_high: int) -> None: ...
|
||||
def device_encoding(fd: int) -> Optional[str]: ...
|
||||
@@ -212,7 +212,7 @@ def fsync(fd: int) -> None: ...
|
||||
def ftruncate(fd: int, length: int) -> None: ... # Unix only
|
||||
def isatty(fd: int) -> bool: ... # Unix only
|
||||
def lseek(fd: int, pos: int, how: int) -> int: ...
|
||||
def open(file: AnyStr, flags: int, mode: int = 0o777) -> int: ...
|
||||
def open(file: AnyStr, flags: int, mode: int = ...) -> int: ...
|
||||
def openpty() -> Tuple[int, int]: ... # some flavors of Unix
|
||||
def pipe() -> Tuple[int, int]: ...
|
||||
def read(fd: int, n: int) -> bytes: ...
|
||||
@@ -235,19 +235,19 @@ def lchown(path: str, uid: int, gid: int) -> None: ... # Unix only
|
||||
def link(src: AnyStr, link_name: AnyStr) -> None: ...
|
||||
|
||||
@overload
|
||||
def listdir(path: str = '.') -> List[str]: ...
|
||||
def listdir(path: str = ...) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: bytes) -> List[bytes]: ...
|
||||
|
||||
def lstat(path: AnyStr) -> stat_result: ...
|
||||
def mkfifo(path, mode: int=0o666) -> None: ... # Unix only
|
||||
def mknod(filename: AnyStr, mode: int = 0o600, device: int = 0) -> None: ...
|
||||
def mkfifo(path, mode: int=...) -> None: ... # Unix only
|
||||
def mknod(filename: AnyStr, mode: int = ..., device: int = ...) -> None: ...
|
||||
def major(device: int) -> int: ...
|
||||
def minor(device: int) -> int: ...
|
||||
def makedev(major: int, minor: int) -> int: ...
|
||||
def mkdir(path: AnyStr, mode: int = 0o777) -> None: ...
|
||||
def makedirs(path: AnyStr, mode: int = 0o777,
|
||||
exist_ok: bool = False) -> None: ...
|
||||
def mkdir(path: AnyStr, mode: int = ...) -> None: ...
|
||||
def makedirs(path: AnyStr, mode: int = ...,
|
||||
exist_ok: bool = ...) -> None: ...
|
||||
def pathconf(path: str, name: str) -> int: ... # Unix only
|
||||
def readlink(path: AnyStr) -> AnyStr: ...
|
||||
def remove(path: AnyStr) -> None: ...
|
||||
@@ -256,17 +256,17 @@ def rename(src: AnyStr, dst: AnyStr) -> None: ...
|
||||
def renames(old: AnyStr, new: AnyStr) -> None: ...
|
||||
def rmdir(path: AnyStr) -> None: ...
|
||||
def stat(path: AnyStr) -> stat_result: ...
|
||||
def stat_float_times(newvalue: Union[bool, None] = None) -> bool: ...
|
||||
def stat_float_times(newvalue: Union[bool, None] = ...) -> bool: ...
|
||||
def statvfs(path: str) -> statvfs_result: ... # Unix only
|
||||
def symlink(source: AnyStr, link_name: AnyStr,
|
||||
target_is_directory: bool = False) -> None:
|
||||
target_is_directory: bool = ...) -> None:
|
||||
... # final argument in Windows only
|
||||
def unlink(path: AnyStr) -> None: ...
|
||||
def utime(path: AnyStr, times: Union[Tuple[int, int], Tuple[float, float]] = None) -> None: ...
|
||||
def utime(path: AnyStr, times: Union[Tuple[int, int], Tuple[float, float]] = ...) -> None: ...
|
||||
|
||||
# TODO onerror: function from OSError to void
|
||||
def walk(top: AnyStr, topdown: bool = True, onerror: Any = None,
|
||||
followlinks: bool = False) -> Iterator[Tuple[AnyStr, List[AnyStr],
|
||||
def walk(top: AnyStr, topdown: bool = ..., onerror: Any = ...,
|
||||
followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr],
|
||||
List[AnyStr]]]: ...
|
||||
# walk(): "By default errors from the os.listdir() call are ignored. If
|
||||
# optional arg 'onerror' is specified, it should be a function; it
|
||||
@@ -298,8 +298,8 @@ def plock(op: int) -> None: ... # Unix only ???op is int?
|
||||
from io import TextIOWrapper as _TextIOWrapper
|
||||
class popen(_TextIOWrapper):
|
||||
# TODO 'b' modes or bytes command not accepted?
|
||||
def __init__(self, command: str, mode: str = 'r',
|
||||
bufsize: int = -1) -> None: ...
|
||||
def __init__(self, command: str, mode: str = ...,
|
||||
bufsize: int = ...) -> None: ...
|
||||
def close(self) -> Any: ... # may return int
|
||||
|
||||
def spawnl(mode: int, path: AnyStr, arg0: AnyStr, *args: AnyStr) -> int: ...
|
||||
@@ -316,12 +316,12 @@ def spawnvp(mode: int, file: AnyStr, args: List[AnyStr]) -> int: ... # Unix onl
|
||||
def spawnvpe(mode: int, file: AnyStr, args: List[AnyStr],
|
||||
env: Mapping[str, str]) -> int:
|
||||
... # Unix only
|
||||
def startfile(path: str, operation: Union[str, None] = None) -> None: ... # Windows only
|
||||
def startfile(path: str, operation: Union[str, None] = ...) -> None: ... # Windows only
|
||||
def system(command: AnyStr) -> int: ...
|
||||
def times() -> Tuple[float, float, float, float, float]: ...
|
||||
def wait() -> Tuple[int, int]: ... # Unix only
|
||||
def waitpid(pid: int, options: int) -> Tuple[int, int]: ...
|
||||
def wait3(options: Union[int, None] = None) -> Tuple[int, int, Any]: ... # Unix only
|
||||
def wait3(options: Union[int, None] = ...) -> Tuple[int, int, Any]: ... # Unix only
|
||||
def wait4(pid: int, options: int) -> Tuple[int, int, Any]:
|
||||
... # Unix only
|
||||
def WCOREDUMP(status: int) -> bool: ... # Unix only
|
||||
|
||||
@@ -47,7 +47,7 @@ def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ...
|
||||
def normcase(path: AnyStr) -> AnyStr: ...
|
||||
def normpath(path: AnyStr) -> AnyStr: ...
|
||||
def realpath(path: AnyStr) -> AnyStr: ...
|
||||
def relpath(path: AnyStr, start: AnyStr = None) -> AnyStr: ...
|
||||
def relpath(path: AnyStr, start: AnyStr = ...) -> AnyStr: ...
|
||||
|
||||
def samefile(path1: AnyStr, path2: AnyStr) -> bool: ...
|
||||
def sameopenfile(fp1: int, fp2: int) -> bool: ...
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
from typing import Any, IO
|
||||
|
||||
def dumps(obj: Any, protocol: int = None, *,
|
||||
fix_imports: bool = True) -> bytes: ...
|
||||
def loads(p: bytes, *, fix_imports: bool = True,
|
||||
encoding: str = 'ASCII', errors: str = 'strict') -> Any: ...
|
||||
def load(file: IO[bytes], *, fix_imports: bool = True, encoding: str = 'ASCII',
|
||||
errors: str = 'strict') -> Any: ...
|
||||
def dumps(obj: Any, protocol: int = ..., *,
|
||||
fix_imports: bool = ...) -> bytes: ...
|
||||
def loads(p: bytes, *, fix_imports: bool = ...,
|
||||
encoding: str = ..., errors: str = ...) -> Any: ...
|
||||
def load(file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ...,
|
||||
errors: str = ...) -> Any: ...
|
||||
|
||||
@@ -4,15 +4,15 @@ from typing import Tuple, NamedTuple
|
||||
|
||||
from os import devnull as DEV_NULL
|
||||
|
||||
def libc_ver(executable: str = ..., lib: str = '', version: str = '', chunksize: int = 16384) -> Tuple[str, str]: ...
|
||||
def linux_distribution(distname: str = '', version: str = '', id: str = '', supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = True) -> Tuple[str, str, str]: ...
|
||||
def dist(distname: str = '', version: str = '', id: str = '', supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ...
|
||||
def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ...
|
||||
def linux_distribution(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = ...) -> Tuple[str, str, str]: ...
|
||||
def dist(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ...
|
||||
from os import popen
|
||||
def win32_ver(release: str = '', version: str = '', csd: str = '', ptype: str = '') -> Tuple[str, str, str, str]: ...
|
||||
def mac_ver(release: str = '', versioninfo: Tuple[str, str, str] = ..., machine: str = '') -> Tuple[str, Tuple[str, str, str], str]: ...
|
||||
def java_ver(release: str = '', vendor: str = '', vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ...) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ...
|
||||
def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> Tuple[str, str, str, str]: ...
|
||||
def mac_ver(release: str = ..., versioninfo: Tuple[str, str, str] = ..., machine: str = ...) -> Tuple[str, Tuple[str, str, str], str]: ...
|
||||
def java_ver(release: str = ..., vendor: str = ..., vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ...) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ...
|
||||
def system_alias(system: str, release: str, version: str) -> Tuple[str, str, str]: ...
|
||||
def architecture(executable: str = ..., bits: str = '', linkage: str = '') -> Tuple[str, str]: ...
|
||||
def architecture(executable: str = ..., bits: str = ..., linkage: str = ...) -> Tuple[str, str]: ...
|
||||
|
||||
uname_result = NamedTuple('uname_result', [('system', str), ('node', str), ('release', str), ('version', str), ('machine', str), ('processor', str)])
|
||||
|
||||
@@ -32,4 +32,4 @@ def python_revision() -> str: ...
|
||||
def python_build() -> Tuple[str, str]: ...
|
||||
def python_compiler() -> str: ...
|
||||
|
||||
def platform(aliased: bool = False, terse: bool = False) -> str: ...
|
||||
def platform(aliased: bool = ..., terse: bool = ...) -> str: ...
|
||||
|
||||
@@ -33,7 +33,7 @@ def join(path: str, *paths: str) -> str: ...
|
||||
def normcase(path: str) -> str: ...
|
||||
def normpath(path: str) -> str: ...
|
||||
def realpath(path: str) -> str: ...
|
||||
def relpath(path: str, start: str = None) -> str: ...
|
||||
def relpath(path: str, start: str = ...) -> str: ...
|
||||
def samefile(path1: str, path2: str) -> bool: ...
|
||||
|
||||
def sameopenfile(fp1: IO[Any], fp2: IO[Any]) -> bool: ...
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
|
||||
from typing import Any, Dict, Tuple, TextIO
|
||||
|
||||
def pformat(o: object, indent: int = 1, width: int = 80,
|
||||
depth: int = None) -> str: ...
|
||||
def pprint(o: object, stream: TextIO = None, indent: int = 1, width: int = 80,
|
||||
depth: int = None) -> None: ...
|
||||
def pformat(o: object, indent: int = ..., width: int = ...,
|
||||
depth: int = ...) -> str: ...
|
||||
def pprint(o: object, stream: TextIO = ..., indent: int = ..., width: int = ...,
|
||||
depth: int = ...) -> None: ...
|
||||
def isreadable(o: object) -> bool: ...
|
||||
def isrecursive(o: object) -> bool: ...
|
||||
def saferepr(o: object) -> str: ...
|
||||
|
||||
class PrettyPrinter:
|
||||
def __init__(self, indent: int = 1, width: int = 80, depth: int = None,
|
||||
stream: TextIO = None) -> None: ...
|
||||
def __init__(self, indent: int = ..., width: int = ..., depth: int = ...,
|
||||
stream: TextIO = ...) -> None: ...
|
||||
def pformat(self, o: object) -> str: ...
|
||||
def pprint(self, o: object) -> None: ...
|
||||
def isreadable(self, o: object) -> bool: ...
|
||||
|
||||
@@ -7,11 +7,11 @@ from typing import Any, TypeVar, Generic
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class Queue(Generic[_T]):
|
||||
def __init__(self, maxsize: int = 0) -> None: ...
|
||||
def __init__(self, maxsize: int = ...) -> None: ...
|
||||
def full(self) -> bool: ...
|
||||
def get(self, block: bool = True, timeout: float = None) -> _T: ...
|
||||
def get(self, block: bool = ..., timeout: float = ...) -> _T: ...
|
||||
def get_nowait(self) -> _T: ...
|
||||
def put(self, item: _T, block: bool = True, timeout: float = None) -> None: ...
|
||||
def put(self, item: _T, block: bool = ..., timeout: float = ...) -> None: ...
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
def join(self) -> None: ...
|
||||
def qsize(self) -> int: ...
|
||||
|
||||
@@ -14,20 +14,20 @@ from typing import (
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class Random(_random.Random):
|
||||
def __init__(self, x: Any = None) -> None: ...
|
||||
def seed(self, a: Any = None, version: int = 2) -> None: ...
|
||||
def __init__(self, x: Any = ...) -> None: ...
|
||||
def seed(self, a: Any = ..., version: int = ...) -> None: ...
|
||||
def getstate(self) -> tuple: ...
|
||||
def setstate(self, state: tuple) -> None: ...
|
||||
def getrandbits(self, k: int) -> int: ...
|
||||
def randrange(self, start: int, stop: Union[int, None] = None, step: int = 1) -> int: ...
|
||||
def randrange(self, start: int, stop: Union[int, None] = ..., step: int = ...) -> int: ...
|
||||
def randint(self, a: int, b: int) -> int: ...
|
||||
def choice(self, seq: Sequence[_T]) -> _T: ...
|
||||
def shuffle(self, x: List[Any], random: Union[Callable[[], float], None] = None) -> None: ...
|
||||
def shuffle(self, x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ...
|
||||
def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
|
||||
def random(self) -> float: ...
|
||||
def uniform(self, a: float, b: float) -> float: ...
|
||||
def triangular(self, low: float = 0.0, high: float = 1.0,
|
||||
mode: float = None) -> float: ...
|
||||
def triangular(self, low: float = ..., high: float = ...,
|
||||
mode: float = ...) -> float: ...
|
||||
def betavariate(self, alpha: float, beta: float) -> float: ...
|
||||
def expovariate(self, lambd: float) -> float: ...
|
||||
def gammavariate(self, alpha: float, beta: float) -> float: ...
|
||||
@@ -40,25 +40,25 @@ class Random(_random.Random):
|
||||
|
||||
# SystemRandom is not implemented for all OS's; good on Windows & Linux
|
||||
class SystemRandom:
|
||||
def __init__(self, randseed: object = None) -> None: ...
|
||||
def __init__(self, randseed: object = ...) -> None: ...
|
||||
def random(self) -> float: ...
|
||||
def getrandbits(self, k: int) -> int: ...
|
||||
def seed(self, arg: object) -> None: ...
|
||||
|
||||
# ----- random function stubs -----
|
||||
def seed(a: Any = None, version: int = 2) -> None: ...
|
||||
def seed(a: Any = ..., version: int = ...) -> None: ...
|
||||
def getstate() -> object: ...
|
||||
def setstate(state: object) -> None: ...
|
||||
def getrandbits(k: int) -> int: ...
|
||||
def randrange(start: int, stop: Union[None, int] = None, step: int = 1) -> int: ...
|
||||
def randrange(start: int, stop: Union[None, int] = ..., step: int = ...) -> int: ...
|
||||
def randint(a: int, b: int) -> int: ...
|
||||
def choice(seq: Sequence[_T]) -> _T: ...
|
||||
def shuffle(x: List[Any], random: Union[Callable[[], float], None] = None) -> None: ...
|
||||
def shuffle(x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ...
|
||||
def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
|
||||
def random() -> float: ...
|
||||
def uniform(a: float, b: float) -> float: ...
|
||||
def triangular(low: float = 0.0, high: float = 1.0,
|
||||
mode: float = None) -> float: ...
|
||||
def triangular(low: float = ..., high: float = ...,
|
||||
mode: float = ...) -> float: ...
|
||||
def betavariate(alpha: float, beta: float) -> float: ...
|
||||
def expovariate(lambd: float) -> float: ...
|
||||
def gammavariate(alpha: float, beta: float) -> float: ...
|
||||
|
||||
@@ -29,28 +29,28 @@ UNICODE = 0
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
def compile(pattern: AnyStr, flags: int = 0) -> Pattern[AnyStr]: ...
|
||||
def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ...
|
||||
def search(pattern: AnyStr, string: AnyStr,
|
||||
flags: int = 0) -> Match[AnyStr]: ...
|
||||
flags: int = ...) -> Match[AnyStr]: ...
|
||||
def match(pattern: AnyStr, string: AnyStr,
|
||||
flags: int = 0) -> Match[AnyStr]: ...
|
||||
def split(pattern: AnyStr, string: AnyStr, maxsplit: int = 0,
|
||||
flags: int = 0) -> List[AnyStr]: ...
|
||||
flags: int = ...) -> Match[AnyStr]: ...
|
||||
def split(pattern: AnyStr, string: AnyStr, maxsplit: int = ...,
|
||||
flags: int = ...) -> List[AnyStr]: ...
|
||||
def findall(pattern: AnyStr, string: AnyStr,
|
||||
flags: int = 0) -> List[AnyStr]: ...
|
||||
flags: int = ...) -> List[AnyStr]: ...
|
||||
|
||||
# Return an iterator yielding match objects over all non-overlapping matches
|
||||
# for the RE pattern in string. The string is scanned left-to-right, and
|
||||
# matches are returned in the order found. Empty matches are included in the
|
||||
# result unless they touch the beginning of another match.
|
||||
def finditer(pattern: AnyStr, string: AnyStr,
|
||||
flags: int = 0) -> Iterator[Match[AnyStr]]: ...
|
||||
flags: int = ...) -> Iterator[Match[AnyStr]]: ...
|
||||
|
||||
def sub(pattern: AnyStr, repl: Union[AnyStr, Callable[[Match[AnyStr]], AnyStr]],
|
||||
string: AnyStr, count: int = 0, flags: int = 0) -> AnyStr: ...
|
||||
string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...
|
||||
|
||||
def subn(pattern: AnyStr, repl: Union[AnyStr, Callable[[Match[AnyStr]], AnyStr]],
|
||||
string: AnyStr, count: int = 0, flags: int = 0) -> Tuple[AnyStr, int]:
|
||||
string: AnyStr, count: int = ..., flags: int = ...) -> Tuple[AnyStr, int]:
|
||||
...
|
||||
|
||||
def escape(string: AnyStr) -> AnyStr: ...
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
from typing import List, Tuple, Any, TextIO
|
||||
|
||||
def split(s: str, comments: bool = False,
|
||||
posix: bool = True) -> List[str]: ...
|
||||
def split(s: str, comments: bool = ...,
|
||||
posix: bool = ...) -> List[str]: ...
|
||||
|
||||
# Added in 3.3, use (undocumented) pipes.quote in previous versions.
|
||||
def quote(s: str) -> str: ...
|
||||
@@ -26,14 +26,14 @@ class shlex:
|
||||
token = ... # type: str
|
||||
eof = ... # type: str
|
||||
|
||||
def __init__(self, instream=None, infile=None,
|
||||
posix: bool = False) -> None: ...
|
||||
def __init__(self, instream=..., infile=...,
|
||||
posix: bool = ...) -> None: ...
|
||||
def get_token(self) -> str: ...
|
||||
def push_token(self, tok: str) -> None: ...
|
||||
def read_token(self) -> str: ...
|
||||
def sourcehook(self, filename: str) -> Tuple[str, TextIO]: ...
|
||||
# TODO argument types
|
||||
def push_source(self, newstream: Any, newfile: Any = None) -> None: ...
|
||||
def push_source(self, newstream: Any, newfile: Any = ...) -> None: ...
|
||||
def pop_source(self) -> None: ...
|
||||
def error_leader(self, infile: str = None,
|
||||
lineno: int = None) -> None: ...
|
||||
def error_leader(self, infile: str = ...,
|
||||
lineno: int = ...) -> None: ...
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
from typing import List, Iterable, Callable, Any, Tuple, Sequence, IO, AnyStr
|
||||
|
||||
def copyfileobj(fsrc: IO[AnyStr], fdst: IO[AnyStr],
|
||||
length: int = None) -> None: ...
|
||||
length: int = ...) -> None: ...
|
||||
|
||||
def copyfile(src: str, dst: str) -> None: ...
|
||||
def copymode(src: str, dst: str) -> None: ...
|
||||
@@ -18,29 +18,29 @@ def copy(src: str, dst: str) -> None: ...
|
||||
def copy2(src: str, dst: str) -> None: ...
|
||||
def ignore_patterns(*patterns: str) -> Callable[[str, List[str]],
|
||||
Iterable[str]]: ...
|
||||
def copytree(src: str, dst: str, symlinks: bool = False,
|
||||
ignore: Callable[[str, List[str]], Iterable[str]] = None,
|
||||
copy_function: Callable[[str, str], None] = copy2,
|
||||
ignore_dangling_symlinks: bool = False) -> None: ...
|
||||
def rmtree(path: str, ignore_errors: bool = False,
|
||||
onerror: Callable[[Any, str, Any], None] = None) -> None: ...
|
||||
def copytree(src: str, dst: str, symlinks: bool = ...,
|
||||
ignore: Callable[[str, List[str]], Iterable[str]] = ...,
|
||||
copy_function: Callable[[str, str], None] = ...,
|
||||
ignore_dangling_symlinks: bool = ...) -> None: ...
|
||||
def rmtree(path: str, ignore_errors: bool = ...,
|
||||
onerror: Callable[[Any, str, Any], None] = ...) -> None: ...
|
||||
def move(src: str, dst: str) -> None: ...
|
||||
|
||||
class Error(Exception): ...
|
||||
|
||||
def make_archive(base_name: str, format: str, root_dir: str = None,
|
||||
base_dir: str = None, verbose: bool = False,
|
||||
dry_run: bool = False, owner: str = None, group: str = None,
|
||||
logger: Any = None) -> str: ...
|
||||
def make_archive(base_name: str, format: str, root_dir: str = ...,
|
||||
base_dir: str = ..., verbose: bool = ...,
|
||||
dry_run: bool = ..., owner: str = ..., group: str = ...,
|
||||
logger: Any = ...) -> str: ...
|
||||
def get_archive_formats() -> List[Tuple[str, str]]: ...
|
||||
def register_archive_format(name: str, function: Any,
|
||||
extra_args: Sequence[Tuple[str, Any]] = None,
|
||||
description: str = None) -> None: ...
|
||||
extra_args: Sequence[Tuple[str, Any]] = ...,
|
||||
description: str = ...) -> None: ...
|
||||
def unregister_archive_format(name: str) -> None: ...
|
||||
def unpack_archive(filename: str, extract_dir: str = None,
|
||||
format: str = None) -> None: ...
|
||||
def unpack_archive(filename: str, extract_dir: str = ...,
|
||||
format: str = ...) -> None: ...
|
||||
def register_unpack_format(name: str, extensions: List[str], function: Any,
|
||||
extra_args: Sequence[Tuple[str, Any]] = None,
|
||||
description: str = None) -> None: ...
|
||||
extra_args: Sequence[Tuple[str, Any]] = ...,
|
||||
description: str = ...) -> None: ...
|
||||
def unregister_unpack_format(name: str) -> None: ...
|
||||
def get_unpack_formats() -> List[Tuple[str, List[str], str]]: ...
|
||||
|
||||
@@ -45,21 +45,21 @@ class SMTP:
|
||||
esmtp_features = ... # type: Any
|
||||
source_address = ... # type: Any
|
||||
local_hostname = ... # type: Any
|
||||
def __init__(self, host='', port=0, local_hostname=None, timeout=...,
|
||||
source_address=None): ...
|
||||
def __init__(self, host=..., port=..., local_hostname=..., timeout=...,
|
||||
source_address=...): ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, *args): ...
|
||||
def set_debuglevel(self, debuglevel): ...
|
||||
sock = ... # type: Any
|
||||
def connect(self, host='', port=0, source_address=None): ...
|
||||
def connect(self, host=..., port=..., source_address=...): ...
|
||||
def send(self, s): ...
|
||||
def putcmd(self, cmd, args=''): ...
|
||||
def putcmd(self, cmd, args=...): ...
|
||||
def getreply(self): ...
|
||||
def docmd(self, cmd, args=''): ...
|
||||
def helo(self, name=''): ...
|
||||
def ehlo(self, name=''): ...
|
||||
def docmd(self, cmd, args=...): ...
|
||||
def helo(self, name=...): ...
|
||||
def ehlo(self, name=...): ...
|
||||
def has_extn(self, opt): ...
|
||||
def help(self, args=''): ...
|
||||
def help(self, args=...): ...
|
||||
def rset(self): ...
|
||||
def noop(self): ...
|
||||
def mail(self, sender, options=...): ...
|
||||
@@ -70,10 +70,10 @@ class SMTP:
|
||||
def expn(self, address): ...
|
||||
def ehlo_or_helo_if_needed(self): ...
|
||||
def login(self, user, password): ...
|
||||
def starttls(self, keyfile=None, certfile=None, context=None): ...
|
||||
def starttls(self, keyfile=..., certfile=..., context=...): ...
|
||||
def sendmail(self, from_addr, to_addrs, msg, mail_options=...,
|
||||
rcpt_options=...): ...
|
||||
def send_message(self, msg, from_addr=None, to_addrs=None, mail_options=...,
|
||||
def send_message(self, msg, from_addr=..., to_addrs=..., mail_options=...,
|
||||
rcpt_options=...): ...
|
||||
def close(self): ...
|
||||
def quit(self): ...
|
||||
@@ -83,12 +83,12 @@ class SMTP_SSL(SMTP):
|
||||
keyfile = ... # type: Any
|
||||
certfile = ... # type: Any
|
||||
context = ... # type: Any
|
||||
def __init__(self, host='', port=0, local_hostname=None, keyfile=None, certfile=None,
|
||||
timeout=..., source_address=None, context=None): ...
|
||||
def __init__(self, host=..., port=..., local_hostname=..., keyfile=..., certfile=...,
|
||||
timeout=..., source_address=..., context=...): ...
|
||||
|
||||
class LMTP(SMTP):
|
||||
ehlo_msg = ... # type: Any
|
||||
def __init__(self, host='', port=..., local_hostname=None, source_address=None) -> None: ...
|
||||
def __init__(self, host=..., port=..., local_hostname=..., source_address=...) -> None: ...
|
||||
sock = ... # type: Any
|
||||
file = ... # type: Any
|
||||
def connect(self, host='', port=0, source_address=None): ...
|
||||
def connect(self, host=..., port=..., source_address=...): ...
|
||||
|
||||
@@ -276,8 +276,8 @@ class socket:
|
||||
type = 0
|
||||
proto = 0
|
||||
|
||||
def __init__(self, family: int = AF_INET, type: int = SOCK_STREAM,
|
||||
proto: int = 0, fileno: int = None) -> None: ...
|
||||
def __init__(self, family: int = ..., type: int = ...,
|
||||
proto: int = ..., fileno: int = ...) -> None: ...
|
||||
|
||||
# --- methods ---
|
||||
# second tuple item is an address
|
||||
@@ -317,26 +317,26 @@ class socket:
|
||||
option: Tuple[int, int, int]) -> None: ...
|
||||
def listen(self, backlog: int) -> None: ...
|
||||
# TODO the return value may be BinaryIO or TextIO, depending on mode
|
||||
def makefile(self, mode: str = 'r', buffering: int = None,
|
||||
encoding: str = None, errors: str = None,
|
||||
newline: str = None) -> Any:
|
||||
def makefile(self, mode: str = ..., buffering: int = ...,
|
||||
encoding: str = ..., errors: str = ...,
|
||||
newline: str = ...) -> Any:
|
||||
...
|
||||
def recv(self, bufsize: int, flags: int = 0) -> bytes: ...
|
||||
def recv(self, bufsize: int, flags: int = ...) -> bytes: ...
|
||||
|
||||
# return type is an address
|
||||
def recvfrom(self, bufsize: int, flags: int = 0) -> Any: ...
|
||||
def recvfrom(self, bufsize: int, flags: int = ...) -> Any: ...
|
||||
def recvfrom_into(self, buffer: bytes, nbytes: int,
|
||||
flags: int = 0) -> Any: ...
|
||||
flags: int = ...) -> Any: ...
|
||||
def recv_into(self, buffer: bytes, nbytes: int,
|
||||
flags: int = 0) -> Any: ...
|
||||
def send(self, data: bytes, flags=0) -> int: ...
|
||||
def sendall(self, data: bytes, flags=0) -> Any:
|
||||
flags: int = ...) -> Any: ...
|
||||
def send(self, data: bytes, flags=...) -> int: ...
|
||||
def sendall(self, data: bytes, flags=...) -> Any:
|
||||
... # return type: None on success
|
||||
|
||||
@overload
|
||||
def sendto(self, data: bytes, address: tuple, flags: int = 0) -> int: ...
|
||||
def sendto(self, data: bytes, address: tuple, flags: int = ...) -> int: ...
|
||||
@overload
|
||||
def sendto(self, data: bytes, address: str, flags: int = 0) -> int: ...
|
||||
def sendto(self, data: bytes, address: str, flags: int = ...) -> int: ...
|
||||
|
||||
def setblocking(self, flag: bool) -> None: ...
|
||||
# TODO None valid for the value argument
|
||||
@@ -352,28 +352,28 @@ class socket:
|
||||
|
||||
# ----- functions -----
|
||||
def create_connection(address: Tuple[str, int],
|
||||
timeout: float = _GLOBAL_DEFAULT_TIMEOUT,
|
||||
source_address: Tuple[str, int] = None) -> socket: ...
|
||||
timeout: float = ...,
|
||||
source_address: Tuple[str, int] = ...) -> socket: ...
|
||||
|
||||
# the 5th tuple item is an address
|
||||
def getaddrinfo(
|
||||
host: str, port: int, family: int = 0, type: int = 0, proto: int = 0,
|
||||
flags: int = 0) -> List[Tuple[int, int, int, str, tuple]]:
|
||||
host: str, port: int, family: int = ..., type: int = ..., proto: int = ...,
|
||||
flags: int = ...) -> List[Tuple[int, int, int, str, tuple]]:
|
||||
...
|
||||
|
||||
def getfqdn(name: str = '') -> str: ...
|
||||
def getfqdn(name: str = ...) -> str: ...
|
||||
def gethostbyname(hostname: str) -> str: ...
|
||||
def gethostbyname_ex(hostname: str) -> Tuple[str, List[str], List[str]]: ...
|
||||
def gethostname() -> str: ...
|
||||
def gethostbyaddr(ip_address: str) -> Tuple[str, List[str], List[str]]: ...
|
||||
def getnameinfo(sockaddr: tuple, flags: int) -> Tuple[str, int]: ...
|
||||
def getprotobyname(protocolname: str) -> int: ...
|
||||
def getservbyname(servicename: str, protocolname: str = None) -> int: ...
|
||||
def getservbyport(port: int, protocolname: str = None) -> str: ...
|
||||
def socketpair(family: int = AF_INET,
|
||||
type: int = SOCK_STREAM,
|
||||
proto: int = 0) -> Tuple[socket, socket]: ...
|
||||
def fromfd(fd: int, family: int, type: int, proto: int = 0) -> socket: ...
|
||||
def getservbyname(servicename: str, protocolname: str = ...) -> int: ...
|
||||
def getservbyport(port: int, protocolname: str = ...) -> str: ...
|
||||
def socketpair(family: int = ...,
|
||||
type: int = ...,
|
||||
proto: int = ...) -> Tuple[socket, socket]: ...
|
||||
def fromfd(fd: int, family: int, type: int, proto: int = ...) -> socket: ...
|
||||
def ntohl(x: int) -> int: ... # param & ret val are 32-bit ints
|
||||
def ntohs(x: int) -> int: ... # param & ret val are 16-bit ints
|
||||
def htonl(x: int) -> int: ... # param & ret val are 32-bit ints
|
||||
|
||||
@@ -11,5 +11,5 @@ class TCPServer():
|
||||
self,
|
||||
server_address: Tuple[str, int],
|
||||
request_handler: BaseRequestHandler,
|
||||
bind_and_activate: bool = True,
|
||||
bind_and_activate: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
@@ -124,7 +124,7 @@ class _SSLContext:
|
||||
def _set_npn_protocols(self, *args, **kwargs): ...
|
||||
def _wrap_socket(self, *args, **kwargs): ...
|
||||
def cert_store_stats(self): ...
|
||||
def get_ca_certs(self, binary_form=False): ...
|
||||
def get_ca_certs(self, binary_form=...): ...
|
||||
def load_cert_chain(self, *args, **kwargs): ...
|
||||
def load_dh_params(self, *args, **kwargs): ...
|
||||
def load_verify_locations(self, *args, **kwargs): ...
|
||||
@@ -138,12 +138,12 @@ class SSLContext(_SSLContext):
|
||||
def __new__(cls, protocol, *args, **kwargs): ...
|
||||
protocol = ... # type: Any
|
||||
def __init__(self, protocol) -> None: ...
|
||||
def wrap_socket(self, sock, server_side=False, do_handshake_on_connect=True,
|
||||
suppress_ragged_eofs=True, server_hostname=None): ...
|
||||
def wrap_socket(self, sock, server_side=..., do_handshake_on_connect=...,
|
||||
suppress_ragged_eofs=..., server_hostname=...): ...
|
||||
def set_npn_protocols(self, npn_protocols): ...
|
||||
def load_default_certs(self, purpose=...): ...
|
||||
|
||||
def create_default_context(purpose=..., *, cafile=None, capath=None, cadata=None): ...
|
||||
def create_default_context(purpose=..., *, cafile=..., capath=..., cadata=...): ...
|
||||
|
||||
class SSLSocket(socket):
|
||||
keyfile = ... # type: Any
|
||||
@@ -157,40 +157,40 @@ class SSLSocket(socket):
|
||||
do_handshake_on_connect = ... # type: Any
|
||||
suppress_ragged_eofs = ... # type: Any
|
||||
context = ... # type: Any # TODO: This should be a property.
|
||||
def __init__(self, sock=None, keyfile=None, certfile=None, server_side=False,
|
||||
cert_reqs=..., ssl_version=..., ca_certs=None,
|
||||
do_handshake_on_connect=True, family=..., type=..., proto=0,
|
||||
fileno=None, suppress_ragged_eofs=True, npn_protocols=None, ciphers=None,
|
||||
server_hostname=None, _context=None): ...
|
||||
def __init__(self, sock=..., keyfile=..., certfile=..., server_side=...,
|
||||
cert_reqs=..., ssl_version=..., ca_certs=...,
|
||||
do_handshake_on_connect=..., family=..., type=..., proto=...,
|
||||
fileno=..., suppress_ragged_eofs=..., npn_protocols=..., ciphers=...,
|
||||
server_hostname=..., _context=...): ...
|
||||
def dup(self): ...
|
||||
def read(self, len=0, buffer=None): ...
|
||||
def read(self, len=..., buffer=...): ...
|
||||
def write(self, data): ...
|
||||
def getpeercert(self, binary_form=False): ...
|
||||
def getpeercert(self, binary_form=...): ...
|
||||
def selected_npn_protocol(self): ...
|
||||
def cipher(self): ...
|
||||
def compression(self): ...
|
||||
def send(self, data, flags=0): ...
|
||||
def sendto(self, data, flags_or_addr, addr=None): ...
|
||||
def send(self, data, flags=...): ...
|
||||
def sendto(self, data, flags_or_addr, addr=...): ...
|
||||
def sendmsg(self, *args, **kwargs): ...
|
||||
def sendall(self, data, flags=0): ...
|
||||
def recv(self, buflen=1024, flags=0): ...
|
||||
def recv_into(self, buffer, nbytes=None, flags=0): ...
|
||||
def recvfrom(self, buflen=1024, flags=0): ...
|
||||
def recvfrom_into(self, buffer, nbytes=None, flags=0): ...
|
||||
def sendall(self, data, flags=...): ...
|
||||
def recv(self, buflen=..., flags=...): ...
|
||||
def recv_into(self, buffer, nbytes=..., flags=...): ...
|
||||
def recvfrom(self, buflen=..., flags=...): ...
|
||||
def recvfrom_into(self, buffer, nbytes=..., flags=...): ...
|
||||
def recvmsg(self, *args, **kwargs): ...
|
||||
def recvmsg_into(self, *args, **kwargs): ...
|
||||
def pending(self): ...
|
||||
def shutdown(self, how): ...
|
||||
def unwrap(self): ...
|
||||
def do_handshake(self, block=False): ...
|
||||
def do_handshake(self, block=...): ...
|
||||
def connect(self, addr): ...
|
||||
def connect_ex(self, addr): ...
|
||||
def accept(self): ...
|
||||
def get_channel_binding(self, cb_type=''): ...
|
||||
def get_channel_binding(self, cb_type=...): ...
|
||||
|
||||
def wrap_socket(sock, keyfile=None, certfile=None, server_side=False, cert_reqs=...,
|
||||
ssl_version=..., ca_certs=None, do_handshake_on_connect=True,
|
||||
suppress_ragged_eofs=True, ciphers=None): ...
|
||||
def wrap_socket(sock, keyfile=..., certfile=..., server_side=..., cert_reqs=...,
|
||||
ssl_version=..., ca_certs=..., do_handshake_on_connect=...,
|
||||
suppress_ragged_eofs=..., ciphers=...): ...
|
||||
def cert_time_to_seconds(cert_time): ...
|
||||
|
||||
PEM_HEADER = ... # type: Any
|
||||
@@ -198,5 +198,5 @@ PEM_FOOTER = ... # type: Any
|
||||
|
||||
def DER_cert_to_PEM_cert(der_cert_bytes): ...
|
||||
def PEM_cert_to_DER_cert(pem_cert_string): ...
|
||||
def get_server_certificate(addr, ssl_version=..., ca_certs=None): ...
|
||||
def get_server_certificate(addr, ssl_version=..., ca_certs=...): ...
|
||||
def get_protocol_name(protocol_code): ...
|
||||
|
||||
@@ -14,7 +14,7 @@ punctuation = ... # type: str
|
||||
printable = ... # type: str
|
||||
whitespace = ... # type: str
|
||||
|
||||
def capwords(s: str, sep: str = None) -> str: ...
|
||||
def capwords(s: str, sep: str = ...) -> str: ...
|
||||
|
||||
class Template:
|
||||
template = ... # type: str
|
||||
|
||||
@@ -12,7 +12,7 @@ def pack_into(fmt: AnyStr, buffer: Any, offset: int, *v: Any) -> None: ...
|
||||
|
||||
# TODO buffer type
|
||||
def unpack(fmt: AnyStr, buffer: Any) -> Tuple[Any, ...]: ...
|
||||
def unpack_from(fmt: AnyStr, buffer: Any, offset: int = 0) -> Tuple[Any, ...]: ...
|
||||
def unpack_from(fmt: AnyStr, buffer: Any, offset: int = ...) -> Tuple[Any, ...]: ...
|
||||
|
||||
def calcsize(fmt: AnyStr) -> int: ...
|
||||
|
||||
@@ -27,4 +27,4 @@ class Struct:
|
||||
def pack_into(self, buffer: Any, offset: int, *v: Any) -> None: ...
|
||||
# TODO buffer type
|
||||
def unpack(self, buffer: Any) -> Tuple[Any, ...]: ...
|
||||
def unpack_from(self, buffer: Any, offset: int = 0) -> Tuple[Any, ...]: ...
|
||||
def unpack_from(self, buffer: Any, offset: int = ...) -> Tuple[Any, ...]: ...
|
||||
|
||||
@@ -6,19 +6,19 @@ from typing import Sequence, Any, Mapping, Callable, Tuple, IO
|
||||
|
||||
# TODO force keyword arguments
|
||||
# TODO more keyword arguments
|
||||
def call(args: Sequence[str], *, stdin: Any = None, stdout: Any = None,
|
||||
stderr: Any = None, shell: bool = False,
|
||||
env: Mapping[str, str] = None,
|
||||
cwd: str = None) -> int: ...
|
||||
def check_call(args: Sequence[str], *, stdin: Any = None, stdout: Any = None,
|
||||
stderr: Any = None, shell: bool = False,
|
||||
env: Mapping[str, str] = None,
|
||||
cwd: str = None) -> int: ...
|
||||
def call(args: Sequence[str], *, stdin: Any = ..., stdout: Any = ...,
|
||||
stderr: Any = ..., shell: bool = ...,
|
||||
env: Mapping[str, str] = ...,
|
||||
cwd: str = ...) -> int: ...
|
||||
def check_call(args: Sequence[str], *, stdin: Any = ..., stdout: Any = ...,
|
||||
stderr: Any = ..., shell: bool = ...,
|
||||
env: Mapping[str, str] = ...,
|
||||
cwd: str = ...) -> int: ...
|
||||
# Return str/bytes
|
||||
def check_output(args: Sequence[str], *, stdin: Any = None, stderr: Any = None,
|
||||
shell: bool = False, universal_newlines: bool = False,
|
||||
env: Mapping[str, str] = None,
|
||||
cwd: str = None) -> Any: ...
|
||||
def check_output(args: Sequence[str], *, stdin: Any = ..., stderr: Any = ...,
|
||||
shell: bool = ..., universal_newlines: bool = ...,
|
||||
env: Mapping[str, str] = ...,
|
||||
cwd: str = ...) -> Any: ...
|
||||
|
||||
# TODO types
|
||||
PIPE = ... # type: Any
|
||||
@@ -40,27 +40,27 @@ class Popen:
|
||||
|
||||
def __init__(self,
|
||||
args: Sequence[str],
|
||||
bufsize: int = 0,
|
||||
executable: str = None,
|
||||
stdin: Any = None,
|
||||
stdout: Any = None,
|
||||
stderr: Any = None,
|
||||
preexec_fn: Callable[[], Any] = None,
|
||||
close_fds: bool = True,
|
||||
shell: bool = False,
|
||||
cwd: str = None,
|
||||
env: Mapping[str, str] = None,
|
||||
universal_newlines: bool = False,
|
||||
startupinfo: Any = None,
|
||||
creationflags: int = 0,
|
||||
restore_signals: bool = True,
|
||||
start_new_session: bool = False,
|
||||
pass_fds: Any = ()) -> None: ...
|
||||
bufsize: int = ...,
|
||||
executable: str = ...,
|
||||
stdin: Any = ...,
|
||||
stdout: Any = ...,
|
||||
stderr: Any = ...,
|
||||
preexec_fn: Callable[[], Any] = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: str = ...,
|
||||
env: Mapping[str, str] = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...) -> None: ...
|
||||
|
||||
def poll(self) -> int: ...
|
||||
def wait(self) -> int: ...
|
||||
# Return str/bytes
|
||||
def communicate(self, input=None) -> Tuple[Any, Any]: ...
|
||||
def communicate(self, input=...) -> Tuple[Any, Any]: ...
|
||||
def send_signal(self, signal: int) -> None: ...
|
||||
def terminatate(self) -> None: ...
|
||||
def kill(self) -> None: ...
|
||||
|
||||
@@ -14,20 +14,20 @@ class TarFile:
|
||||
def getmember(self, name: str) -> TarInfo: ...
|
||||
def getmembers(self) -> List[TarInfo]: ...
|
||||
def getnames(self) -> List[str]: ...
|
||||
def extractall(self, path: str = ".",
|
||||
members: List[TarInfo] = None) -> None: ...
|
||||
def extractall(self, path: str = ...,
|
||||
members: List[TarInfo] = ...) -> None: ...
|
||||
|
||||
@overload
|
||||
def extract(self, member: str, path: str = "",
|
||||
set_attrs: bool = True) -> None: ...
|
||||
def extract(self, member: str, path: str = ...,
|
||||
set_attrs: bool = ...) -> None: ...
|
||||
@overload
|
||||
def extract(self, member: TarInfo, path: str = "",
|
||||
set_attrs: bool = True) -> None: ...
|
||||
def extract(self, member: TarInfo, path: str = ...,
|
||||
set_attrs: bool = ...) -> None: ...
|
||||
|
||||
def add(self, name: str, arcname: str = None, recursive: bool = True,
|
||||
exclude: Callable[[str], bool] = None, *,
|
||||
filter: 'Callable[[TarFile], TarFile]' = None) -> None: ...
|
||||
def add(self, name: str, arcname: str = ..., recursive: bool = ...,
|
||||
exclude: Callable[[str], bool] = ..., *,
|
||||
filter: 'Callable[[TarFile], TarFile]' = ...) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
def open(name: str = None, mode: str = 'r', fileobj: Any = None, bufsize: int = 10240,
|
||||
def open(name: str = ..., mode: str = ..., fileobj: Any = ..., bufsize: int = ...,
|
||||
**kwargs) -> TarFile: ...
|
||||
|
||||
@@ -13,33 +13,33 @@ template = ... # type: str
|
||||
|
||||
# function stubs
|
||||
def TemporaryFile(
|
||||
mode: str = 'w+b', buffering: int = None, encoding: str = None,
|
||||
newline: str = None, suffix: str = '', prefix: str = 'tmp',
|
||||
dir: str = None) -> BinaryIO:
|
||||
mode: str = ..., buffering: int = ..., encoding: str = ...,
|
||||
newline: str = ..., suffix: str = ..., prefix: str = ...,
|
||||
dir: str = ...) -> BinaryIO:
|
||||
...
|
||||
def NamedTemporaryFile(
|
||||
mode: str = 'w+b', buffering: int = None, encoding: str = None,
|
||||
newline: str = None, suffix: str = '', prefix: str = 'tmp',
|
||||
dir: str = None, delete=True) -> BinaryIO:
|
||||
mode: str = ..., buffering: int = ..., encoding: str = ...,
|
||||
newline: str = ..., suffix: str = ..., prefix: str = ...,
|
||||
dir: str = ..., delete=...) -> BinaryIO:
|
||||
...
|
||||
def SpooledTemporaryFile(
|
||||
max_size: int = 0, mode: str = 'w+b', buffering: int = None,
|
||||
encoding: str = None, newline: str = None, suffix: str = '',
|
||||
prefix: str = 'tmp', dir: str = None) -> BinaryIO:
|
||||
max_size: int = ..., mode: str = ..., buffering: int = ...,
|
||||
encoding: str = ..., newline: str = ..., suffix: str = ...,
|
||||
prefix: str = ..., dir: str = ...) -> BinaryIO:
|
||||
...
|
||||
|
||||
class TemporaryDirectory:
|
||||
name = ... # type: str
|
||||
def __init__(self, suffix: str = '', prefix: str = 'tmp',
|
||||
dir: str = None) -> None: ...
|
||||
def __init__(self, suffix: str = ..., prefix: str = ...,
|
||||
dir: str = ...) -> None: ...
|
||||
def cleanup(self) -> None: ...
|
||||
def __enter__(self) -> str: ...
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
|
||||
def mkstemp(suffix: str = '', prefix: str = 'tmp', dir: str = None,
|
||||
text: bool = False) -> Tuple[int, str]: ...
|
||||
def mkdtemp(suffix: str = '', prefix: str = 'tmp',
|
||||
dir: str = None) -> str: ...
|
||||
def mktemp(suffix: str = '', prefix: str = 'tmp', dir: str = None) -> str: ...
|
||||
def mkstemp(suffix: str = ..., prefix: str = ..., dir: str = ...,
|
||||
text: bool = ...) -> Tuple[int, str]: ...
|
||||
def mkdtemp(suffix: str = ..., prefix: str = ...,
|
||||
dir: str = ...) -> str: ...
|
||||
def mktemp(suffix: str = ..., prefix: str = ..., dir: str = ...) -> str: ...
|
||||
def gettempdir() -> str: ...
|
||||
def gettempprefix() -> str: ...
|
||||
|
||||
@@ -7,19 +7,19 @@ from typing import (
|
||||
|
||||
class TextWrapper:
|
||||
def __init__(self,
|
||||
width: int = 70,
|
||||
width: int = ...,
|
||||
*,
|
||||
initial_indent: str = '',
|
||||
subsequent_indent: str = '',
|
||||
expand_tabs: bool = True,
|
||||
tabsize: int = 8,
|
||||
replace_whitespace: bool = True,
|
||||
fix_sentence_endings: bool = False,
|
||||
break_long_words: bool = True,
|
||||
break_on_hyphens: bool = True,
|
||||
drop_whitespace: bool = True,
|
||||
max_lines: int = None,
|
||||
placeholder: str = ' [...]'
|
||||
initial_indent: str = ...,
|
||||
subsequent_indent: str = ...,
|
||||
expand_tabs: bool = ...,
|
||||
tabsize: int = ...,
|
||||
replace_whitespace: bool = ...,
|
||||
fix_sentence_endings: bool = ...,
|
||||
break_long_words: bool = ...,
|
||||
break_on_hyphens: bool = ...,
|
||||
drop_whitespace: bool = ...,
|
||||
max_lines: int = ...,
|
||||
placeholder: str = ...
|
||||
) -> None:
|
||||
self.width = width
|
||||
self.initial_indent = initial_indent
|
||||
@@ -61,58 +61,58 @@ class TextWrapper:
|
||||
|
||||
|
||||
def wrap(
|
||||
width: int = 70,
|
||||
width: int = ...,
|
||||
*,
|
||||
initial_indent: str = '',
|
||||
subsequent_indent: str = '',
|
||||
expand_tabs: bool = True,
|
||||
tabsize: int = 8,
|
||||
replace_whitespace: bool = True,
|
||||
fix_sentence_endings: bool = False,
|
||||
break_long_words: bool = True,
|
||||
break_on_hyphens: bool = True,
|
||||
drop_whitespace: bool = True,
|
||||
max_lines: int = None,
|
||||
placeholder: str = ' [...]'
|
||||
initial_indent: str = ...,
|
||||
subsequent_indent: str = ...,
|
||||
expand_tabs: bool = ...,
|
||||
tabsize: int = ...,
|
||||
replace_whitespace: bool = ...,
|
||||
fix_sentence_endings: bool = ...,
|
||||
break_long_words: bool = ...,
|
||||
break_on_hyphens: bool = ...,
|
||||
drop_whitespace: bool = ...,
|
||||
max_lines: int = ...,
|
||||
placeholder: str = ...
|
||||
) -> List[str]:
|
||||
...
|
||||
|
||||
def fill(
|
||||
width: int = 70,
|
||||
width: int = ...,
|
||||
*,
|
||||
initial_indent: str = '',
|
||||
subsequent_indent: str = '',
|
||||
expand_tabs: bool = True,
|
||||
tabsize: int = 8,
|
||||
replace_whitespace: bool = True,
|
||||
fix_sentence_endings: bool = False,
|
||||
break_long_words: bool = True,
|
||||
break_on_hyphens: bool = True,
|
||||
drop_whitespace: bool = True,
|
||||
max_lines: int = None,
|
||||
placeholder: str = ' [...]'
|
||||
initial_indent: str = ...,
|
||||
subsequent_indent: str = ...,
|
||||
expand_tabs: bool = ...,
|
||||
tabsize: int = ...,
|
||||
replace_whitespace: bool = ...,
|
||||
fix_sentence_endings: bool = ...,
|
||||
break_long_words: bool = ...,
|
||||
break_on_hyphens: bool = ...,
|
||||
drop_whitespace: bool = ...,
|
||||
max_lines: int = ...,
|
||||
placeholder: str = ...
|
||||
):
|
||||
...
|
||||
|
||||
def shorten(
|
||||
width: int,
|
||||
*,
|
||||
initial_indent: str = '',
|
||||
subsequent_indent: str = '',
|
||||
expand_tabs: bool = True,
|
||||
tabsize: int = 8,
|
||||
replace_whitespace: bool = True,
|
||||
fix_sentence_endings: bool = False,
|
||||
break_long_words: bool = True,
|
||||
break_on_hyphens: bool = True,
|
||||
drop_whitespace: bool = True,
|
||||
initial_indent: str = ...,
|
||||
subsequent_indent: str = ...,
|
||||
expand_tabs: bool = ...,
|
||||
tabsize: int = ...,
|
||||
replace_whitespace: bool = ...,
|
||||
fix_sentence_endings: bool = ...,
|
||||
break_long_words: bool = ...,
|
||||
break_on_hyphens: bool = ...,
|
||||
drop_whitespace: bool = ...,
|
||||
# Omit `max_lines: int = None`, it is forced to 1 here.
|
||||
placeholder: str = ' [...]'
|
||||
placeholder: str = ...
|
||||
):
|
||||
...
|
||||
|
||||
def dedent(text: str) -> str:
|
||||
...
|
||||
|
||||
def indent(text: str, prefix: str, predicate: Callable[[str], bool] = None) -> str:
|
||||
def indent(text: str, prefix: str, predicate: Callable[[str], bool] = ...) -> str:
|
||||
...
|
||||
|
||||
@@ -9,12 +9,12 @@ class Thread:
|
||||
ident = 0
|
||||
daemon = False
|
||||
|
||||
def __init__(self, group: Any = None, target: Any = None, args: Any = (),
|
||||
kwargs: Dict[Any, Any] = None,
|
||||
verbose: Any = None) -> None: ...
|
||||
def __init__(self, group: Any = ..., target: Any = ..., args: Any = ...,
|
||||
kwargs: Dict[Any, Any] = ...,
|
||||
verbose: Any = ...) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
def join(self, timeout: float = 0.0) -> None: ...
|
||||
def join(self, timeout: float = ...) -> None: ...
|
||||
def is_alive(self) -> bool: ...
|
||||
|
||||
# Legacy methods
|
||||
@@ -28,17 +28,17 @@ class Event:
|
||||
def set(self) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
# TODO can it return None?
|
||||
def wait(self, timeout: float = 0.0) -> bool: ...
|
||||
def wait(self, timeout: float = ...) -> bool: ...
|
||||
|
||||
class Lock:
|
||||
def acquire(self, blocking: bool = True, timeout: float = -1.0) -> bool: ...
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
class RLock:
|
||||
def acquire(self, blocking: bool = True,
|
||||
timeout: float = -1.0) -> Optional[bool]: ...
|
||||
def acquire(self, blocking: bool = ...,
|
||||
timeout: float = ...) -> Optional[bool]: ...
|
||||
def release(self) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
@@ -46,11 +46,11 @@ class RLock:
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class Condition:
|
||||
def acquire(self, blocking: bool = True, timeout: float = -1.0) -> bool: ...
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def notify(self, n: int = 1) -> None: ...
|
||||
def notify(self, n: int = ...) -> None: ...
|
||||
def notify_all(self) -> None: ...
|
||||
def wait(self, timeout: float = None) -> bool: ...
|
||||
def wait_for(self, predicate: Callable[[], _T], timeout: float = None) -> Union[_T, bool]: ...
|
||||
def wait(self, timeout: float = ...) -> bool: ...
|
||||
def wait_for(self, predicate: Callable[[], _T], timeout: float = ...) -> Union[_T, bool]: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, *args): ...
|
||||
|
||||
@@ -5,6 +5,6 @@ import typing
|
||||
# TODO signatures
|
||||
def format_exception_only(etype, value): ...
|
||||
def format_tb(traceback): ...
|
||||
def print_exc(limit=None, file=None, chain=True): ...
|
||||
def print_exc(limit=..., file=..., chain=...): ...
|
||||
|
||||
# TODO add more
|
||||
|
||||
@@ -53,13 +53,13 @@ class CodeType:
|
||||
name: str,
|
||||
firstlineno: int,
|
||||
lnotab: bytes,
|
||||
freevars: Tuple[str, ...] = (),
|
||||
cellvars: Tuple[str, ...] = (),
|
||||
freevars: Tuple[str, ...] = ...,
|
||||
cellvars: Tuple[str, ...] = ...,
|
||||
) -> None: ...
|
||||
|
||||
class MappingProxyType:
|
||||
def copy(self) -> dict: ...
|
||||
def get(self, key: str, default: _T = None) -> Union[Any, _T]: ...
|
||||
def get(self, key: str, default: _T = ...) -> Union[Any, _T]: ...
|
||||
def items(self) -> Iterator[Tuple[str, Any]]: ...
|
||||
def keys(self) -> Iterator[str]: ...
|
||||
def values(self) -> Iterator[Any]: ...
|
||||
@@ -130,18 +130,18 @@ class FrameType:
|
||||
class GetSetDescriptorType:
|
||||
__name__ = ... # type: str
|
||||
__objclass__ = ... # type: type
|
||||
def __get__(self, obj: Any, type: type = None) -> Any: ...
|
||||
def __get__(self, obj: Any, type: type = ...) -> Any: ...
|
||||
def __set__(self, obj: Any) -> None: ...
|
||||
def __delete__(self, obj: Any) -> None: ...
|
||||
class MemberDescriptorType:
|
||||
__name__ = ... # type: str
|
||||
__objclass__ = ... # type: type
|
||||
def __get__(self, obj: Any, type: type = None) -> Any: ...
|
||||
def __get__(self, obj: Any, type: type = ...) -> Any: ...
|
||||
def __set__(self, obj: Any) -> None: ...
|
||||
def __delete__(self, obj: Any) -> None: ...
|
||||
|
||||
def new_class(name: str, bases: Tuple[type, ...] = (), kwds: Dict[str, Any] = None, exec_body: Callable[[Dict[str, Any]], None] = None) -> type: ...
|
||||
def prepare_class(name: str, bases: Tuple[type, ...] = (), kwds: Dict[str, Any] = None) -> Tuple[type, Dict[str, Any], Dict[str, Any]]: ...
|
||||
def new_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ...
|
||||
def prepare_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ...) -> Tuple[type, Dict[str, Any], Dict[str, Any]]: ...
|
||||
|
||||
# Actually a different type, but `property` is special and we want that too.
|
||||
DynamicClassAttribute = property
|
||||
|
||||
@@ -70,7 +70,7 @@ class SupportsAbs(Generic[_T]):
|
||||
|
||||
class SupportsRound(Generic[_T]):
|
||||
@abstractmethod
|
||||
def __round__(self, ndigits: int = 0) -> _T: ...
|
||||
def __round__(self, ndigits: int = ...) -> _T: ...
|
||||
|
||||
class Reversible(Generic[_T]):
|
||||
@abstractmethod
|
||||
@@ -129,7 +129,7 @@ class MutableSequence(Sequence[_T], Generic[_T]):
|
||||
def append(self, object: _T) -> None: ...
|
||||
def extend(self, iterable: Iterable[_T]) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def pop(self, index: int = -1) -> _T: ...
|
||||
def pop(self, index: int = ...) -> _T: ...
|
||||
def remove(self, object: _T) -> None: ...
|
||||
def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ...
|
||||
|
||||
@@ -221,22 +221,22 @@ class IO(Iterable[AnyStr], Generic[AnyStr]):
|
||||
def isatty(self) -> bool: ...
|
||||
# TODO what if n is None?
|
||||
@abstractmethod
|
||||
def read(self, n: int = -1) -> AnyStr: ...
|
||||
def read(self, n: int = ...) -> AnyStr: ...
|
||||
@abstractmethod
|
||||
def readable(self) -> bool: ...
|
||||
@abstractmethod
|
||||
def readline(self, limit: int = -1) -> AnyStr: ...
|
||||
def readline(self, limit: int = ...) -> AnyStr: ...
|
||||
@abstractmethod
|
||||
def readlines(self, hint: int = -1) -> list[AnyStr]: ...
|
||||
def readlines(self, hint: int = ...) -> list[AnyStr]: ...
|
||||
@abstractmethod
|
||||
def seek(self, offset: int, whence: int = 0) -> int: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
@abstractmethod
|
||||
def seekable(self) -> bool: ...
|
||||
@abstractmethod
|
||||
def tell(self) -> int: ...
|
||||
# TODO None should not be compatible with int
|
||||
@abstractmethod
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
@abstractmethod
|
||||
def writable(self) -> bool: ...
|
||||
# TODO buffer objects
|
||||
@@ -297,7 +297,7 @@ class Match(Generic[AnyStr]):
|
||||
def expand(self, template: AnyStr) -> AnyStr: ...
|
||||
|
||||
@overload
|
||||
def group(self, group1: int = 0) -> AnyStr: ...
|
||||
def group(self, group1: int = ...) -> AnyStr: ...
|
||||
@overload
|
||||
def group(self, group1: str) -> AnyStr: ...
|
||||
@overload
|
||||
@@ -307,11 +307,11 @@ class Match(Generic[AnyStr]):
|
||||
def group(self, group1: str, group2: str,
|
||||
*groups: str) -> Sequence[AnyStr]: ...
|
||||
|
||||
def groups(self, default: AnyStr = None) -> Sequence[AnyStr]: ...
|
||||
def groupdict(self, default: AnyStr = None) -> dict[str, AnyStr]: ...
|
||||
def start(self, group: int = 0) -> int: ...
|
||||
def end(self, group: int = 0) -> int: ...
|
||||
def span(self, group: int = 0) -> Tuple[int, int]: ...
|
||||
def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ...
|
||||
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ...
|
||||
def start(self, group: int = ...) -> int: ...
|
||||
def end(self, group: int = ...) -> int: ...
|
||||
def span(self, group: int = ...) -> Tuple[int, int]: ...
|
||||
|
||||
class Pattern(Generic[AnyStr]):
|
||||
flags = 0
|
||||
@@ -319,26 +319,26 @@ class Pattern(Generic[AnyStr]):
|
||||
groups = 0
|
||||
pattern = ... # type: AnyStr
|
||||
|
||||
def search(self, string: AnyStr, pos: int = 0,
|
||||
endpos: int = -1) -> Match[AnyStr]: ...
|
||||
def match(self, string: AnyStr, pos: int = 0,
|
||||
endpos: int = -1) -> Match[AnyStr]: ...
|
||||
def split(self, string: AnyStr, maxsplit: int = 0) -> list[AnyStr]: ...
|
||||
def findall(self, string: AnyStr, pos: int = 0,
|
||||
endpos: int = -1) -> list[AnyStr]: ...
|
||||
def finditer(self, string: AnyStr, pos: int = 0,
|
||||
endpos: int = -1) -> Iterator[Match[AnyStr]]: ...
|
||||
def search(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> Match[AnyStr]: ...
|
||||
def match(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> Match[AnyStr]: ...
|
||||
def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ...
|
||||
def findall(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> list[AnyStr]: ...
|
||||
def finditer(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> Iterator[Match[AnyStr]]: ...
|
||||
|
||||
@overload
|
||||
def sub(self, repl: AnyStr, string: AnyStr,
|
||||
count: int = 0) -> AnyStr: ...
|
||||
count: int = ...) -> AnyStr: ...
|
||||
@overload
|
||||
def sub(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr,
|
||||
count: int = 0) -> AnyStr: ...
|
||||
count: int = ...) -> AnyStr: ...
|
||||
|
||||
@overload
|
||||
def subn(self, repl: AnyStr, string: AnyStr,
|
||||
count: int = 0) -> Tuple[AnyStr, int]: ...
|
||||
count: int = ...) -> Tuple[AnyStr, int]: ...
|
||||
@overload
|
||||
def subn(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr,
|
||||
count: int = 0) -> Tuple[AnyStr, int]: ...
|
||||
count: int = ...) -> Tuple[AnyStr, int]: ...
|
||||
|
||||
@@ -61,67 +61,67 @@ class _AssertWarnsContext(_AssertRaisesBaseContext):
|
||||
def __exit__(self, exc_type, exc_value, tb) -> bool: ...
|
||||
|
||||
class TestCase(Testable):
|
||||
def __init__(self, methodName: str = 'runTest') -> None: ...
|
||||
def __init__(self, methodName: str = ...) -> None: ...
|
||||
# TODO failureException
|
||||
def setUp(self) -> None: ...
|
||||
def tearDown(self) -> None: ...
|
||||
def run(self, result: TestResult = None) -> None: ...
|
||||
def run(self, result: TestResult = ...) -> None: ...
|
||||
def debug(self) -> None: ...
|
||||
def assert_(self, expr: Any, msg: object = None) -> None: ...
|
||||
def failUnless(self, expr: Any, msg: object = None) -> None: ...
|
||||
def assertTrue(self, expr: Any, msg: object = None) -> None: ...
|
||||
def assert_(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def failUnless(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def assertTrue(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def assertEqual(self, first: Any, second: Any,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def failUnlessEqual(self, first: Any, second: Any,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertNotEqual(self, first: Any, second: Any,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertSequenceEqual(self, first: Sequence[Any], second: Sequence[Any],
|
||||
msg: object = None,
|
||||
seq_type: type = None) -> None: ...
|
||||
msg: object = ...,
|
||||
seq_type: type = ...) -> None: ...
|
||||
def failIfEqual(self, first: Any, second: Any,
|
||||
msg: object = None) -> None: ...
|
||||
def assertAlmostEqual(self, first: float, second: float, places: int = 7,
|
||||
msg: object = None,
|
||||
delta: float = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertAlmostEqual(self, first: float, second: float, places: int = ...,
|
||||
msg: object = ...,
|
||||
delta: float = ...) -> None: ...
|
||||
def failUnlessAlmostEqual(self, first: float, second: float,
|
||||
places: int = 7,
|
||||
msg: object = None) -> None: ...
|
||||
places: int = ...,
|
||||
msg: object = ...) -> None: ...
|
||||
def assertNotAlmostEqual(self, first: float, second: float,
|
||||
places: int = 7, msg: object = None,
|
||||
delta: float = None) -> None: ...
|
||||
def failIfAlmostEqual(self, first: float, second: float, places: int = 7,
|
||||
msg: object = None) -> None: ...
|
||||
places: int = ..., msg: object = ...,
|
||||
delta: float = ...) -> None: ...
|
||||
def failIfAlmostEqual(self, first: float, second: float, places: int = ...,
|
||||
msg: object = ...) -> None: ...
|
||||
def assertGreater(self, first: Any, second: Any,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertGreaterEqual(self, first: Any, second: Any,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertLess(self, first: Any, second: Any,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertLessEqual(self, first: Any, second: Any,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
# TODO: If callableObj is None, the return value is None.
|
||||
def assertRaises(self, excClass: type, callableObj: Any = None,
|
||||
def assertRaises(self, excClass: type, callableObj: Any = ...,
|
||||
*args: Any, **kwargs: Any) -> _AssertRaisesContext: ...
|
||||
def failIf(self, expr: Any, msg: object = None) -> None: ...
|
||||
def assertFalse(self, expr: Any, msg: object = None) -> None: ...
|
||||
def failIf(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def assertFalse(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def assertIs(self, first: object, second: object,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertIsNot(self, first: object, second: object,
|
||||
msg: object = None) -> None: ...
|
||||
def assertIsNone(self, expr: Any, msg: object = None) -> None: ...
|
||||
def assertIsNotNone(self, expr: Any, msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertIsNone(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def assertIsNotNone(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def assertIn(self, first: _T, second: Iterable[_T],
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertNotIn(self, first: _T, second: Iterable[_T],
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertIsInstance(self, obj: Any, cls: type,
|
||||
msg: object = None) -> None: ...
|
||||
msg: object = ...) -> None: ...
|
||||
def assertNotIsInstance(self, obj: Any, cls: type,
|
||||
msg: object = None) -> None: ...
|
||||
def assertWarns(self, expected_warning: type, callable_obj: Any = None,
|
||||
msg: object = ...) -> None: ...
|
||||
def assertWarns(self, expected_warning: type, callable_obj: Any = ...,
|
||||
*args: Any, **kwargs: Any) -> _AssertWarnsContext: ...
|
||||
def fail(self, msg: object = None) -> None: ...
|
||||
def fail(self, msg: object = ...) -> None: ...
|
||||
def countTestCases(self) -> int: ...
|
||||
def defaultTestResult(self) -> TestResult: ...
|
||||
def id(self) -> str: ...
|
||||
@@ -131,15 +131,15 @@ class TestCase(Testable):
|
||||
|
||||
class CallableTestCase(Testable):
|
||||
def __init__(self, testFunc: Callable[[], None],
|
||||
setUp: Callable[[], None] = None,
|
||||
tearDown: Callable[[], None] = None,
|
||||
description: str = None) -> None: ...
|
||||
setUp: Callable[[], None] = ...,
|
||||
tearDown: Callable[[], None] = ...,
|
||||
description: str = ...) -> None: ...
|
||||
def run(self, result: TestResult) -> None: ...
|
||||
def debug(self) -> None: ...
|
||||
def countTestCases(self) -> int: ...
|
||||
|
||||
class TestSuite(Testable):
|
||||
def __init__(self, tests: Iterable[Testable] = None) -> None: ...
|
||||
def __init__(self, tests: Iterable[Testable] = ...) -> None: ...
|
||||
def addTest(self, test: Testable) -> None: ...
|
||||
def addTests(self, tests: Iterable[Testable]) -> None: ...
|
||||
def run(self, result: TestResult) -> None: ...
|
||||
@@ -150,8 +150,8 @@ class TestSuite(Testable):
|
||||
# TODO defaultTestLoader
|
||||
|
||||
class TextTestRunner:
|
||||
def __init__(self, stream: TextIO = None, descriptions: bool = True,
|
||||
verbosity: int = 1, failfast: bool = False) -> None: ...
|
||||
def __init__(self, stream: TextIO = ..., descriptions: bool = ...,
|
||||
verbosity: int = ..., failfast: bool = ...) -> None: ...
|
||||
|
||||
class SkipTest(Exception):
|
||||
...
|
||||
@@ -162,6 +162,6 @@ def skipIf(condition: Any, reason: str) -> Any: ...
|
||||
def expectedFailure(func: _FT) -> _FT: ...
|
||||
def skip(reason: str) -> Any: ...
|
||||
|
||||
def main(module: str = '__main__', defaultTest: str = None,
|
||||
argv: List[str] = None, testRunner: Any = None,
|
||||
testLoader: Any = None) -> None: ... # TODO types
|
||||
def main(module: str = ..., defaultTest: str = ...,
|
||||
argv: List[str] = ..., testRunner: Any = ...,
|
||||
testLoader: Any = ...) -> None: ... # TODO types
|
||||
|
||||
@@ -24,11 +24,11 @@ class _ResultMixinBase(Generic[AnyStr]):
|
||||
def geturl(self) -> AnyStr: ...
|
||||
|
||||
class _ResultMixinStr(_ResultMixinBase[str]):
|
||||
def encode(self, encoding: str = 'ascii', errors: str = 'strict') -> '_ResultMixinBytes': ...
|
||||
def encode(self, encoding: str = ..., errors: str = ...) -> '_ResultMixinBytes': ...
|
||||
|
||||
|
||||
class _ResultMixinBytes(_ResultMixinBase[str]):
|
||||
def decode(self, encoding: str = 'ascii', errors: str = 'strict') -> '_ResultMixinStr': ...
|
||||
def decode(self, encoding: str = ..., errors: str = ...) -> '_ResultMixinStr': ...
|
||||
|
||||
|
||||
class _NetlocResultMixinBase(Generic[AnyStr]):
|
||||
@@ -76,17 +76,17 @@ class SplitResultBytes(_SplitResultBase[bytes], _NetlocResultMixinBytes): ...
|
||||
class ParseResultBytes(_ParseResultBase[bytes], _NetlocResultMixinBytes): ...
|
||||
|
||||
|
||||
def parse_qs(qs: str, keep_blank_values : bool = False, strict_parsing : bool = False, encoding : str = 'utf-8', errors: str = 'replace') -> Dict[str, List[str]]: ...
|
||||
def parse_qs(qs: str, keep_blank_values : bool = ..., strict_parsing : bool = ..., encoding : str = ..., errors: str = ...) -> Dict[str, List[str]]: ...
|
||||
|
||||
def parse_qsl(qs: str, keep_blank_values: bool = False, strict_parsing: bool = False, encoding: str = 'utf-8', errors: str = 'replace') -> List[Tuple[str,str]]: ...
|
||||
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[str,str]]: ...
|
||||
|
||||
def quote(string: AnyStr, safe: AnyStr = None, encoding: str = None, errors: str = None) -> str: ...
|
||||
def quote(string: AnyStr, safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ...
|
||||
|
||||
def quote_from_bytes(bs: bytes, safe: AnyStr = None) -> bytes: ...
|
||||
def quote_from_bytes(bs: bytes, safe: AnyStr = ...) -> bytes: ...
|
||||
|
||||
def quote_plus(string: AnyStr, safe: AnyStr = None, encoding: str = None, errors: str = None) -> str: ...
|
||||
def quote_plus(string: AnyStr, safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ...
|
||||
|
||||
def unquote(string: str, encoding: str = 'utf-8', errors: str = 'replace') -> str: ...
|
||||
def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ...
|
||||
|
||||
def unquote_to_bytes(string: AnyStr) -> bytes: ...
|
||||
|
||||
@@ -96,21 +96,21 @@ def urldefrag(url: str) -> DefragResult: ...
|
||||
def urldefrag(url: bytes) -> DefragResultBytes: ...
|
||||
|
||||
@overload
|
||||
def urlencode(query: Mapping[AnyStr, AnyStr], doseq: bool = False, safe: AnyStr = None, encoding: str = None, errors: str = None) -> str: ...
|
||||
def urlencode(query: Mapping[AnyStr, AnyStr], doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ...
|
||||
@overload
|
||||
def urlencode(query: Sequence[Tuple[AnyStr, AnyStr]], doseq: bool = False, safe: AnyStr = None, encoding: str = None, errors: str = None) -> str: ...
|
||||
def urlencode(query: Sequence[Tuple[AnyStr, AnyStr]], doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ...
|
||||
|
||||
def urljoin(base: AnyStr, url: AnyStr, allow_fragments: bool = True) -> AnyStr: ...
|
||||
def urljoin(base: AnyStr, url: AnyStr, allow_fragments: bool = ...) -> AnyStr: ...
|
||||
|
||||
@overload
|
||||
def urlparse(url: str, scheme: str = None, allow_framgents: bool = True) -> ParseResult: ...
|
||||
def urlparse(url: str, scheme: str = ..., allow_framgents: bool = ...) -> ParseResult: ...
|
||||
@overload
|
||||
def urlparse(url: bytes, scheme: bytes = None, allow_framgents: bool = True) -> ParseResultBytes: ...
|
||||
def urlparse(url: bytes, scheme: bytes = ..., allow_framgents: bool = ...) -> ParseResultBytes: ...
|
||||
|
||||
@overload
|
||||
def urlsplit(url: str, scheme: str = None, allow_fragments: bool = True) -> SplitResult: ...
|
||||
def urlsplit(url: str, scheme: str = ..., allow_fragments: bool = ...) -> SplitResult: ...
|
||||
@overload
|
||||
def urlsplit(url: bytes, scheme: bytes = None, allow_fragments: bool = True) -> SplitResultBytes: ...
|
||||
def urlsplit(url: bytes, scheme: bytes = ..., allow_fragments: bool = ...) -> SplitResultBytes: ...
|
||||
|
||||
@overload
|
||||
def urlunparse(components: Sequence[AnyStr]) -> AnyStr: ...
|
||||
|
||||
@@ -7,7 +7,7 @@ Bytes = __builtins__.bytes
|
||||
FieldsType = Tuple[Int, Int, Int, Int, Int, Int]
|
||||
|
||||
class UUID:
|
||||
def __init__(self, hex: str=None, bytes: Bytes=None, bytes_le: Bytes=None, fields: FieldsType=None, int: Int=None, version: Int=None) -> None: ...
|
||||
def __init__(self, hex: str=..., bytes: Bytes=..., bytes_le: Bytes=..., fields: FieldsType=..., int: Int=..., version: Int=...) -> None: ...
|
||||
|
||||
@property
|
||||
def bytes(self) -> Bytes: ...
|
||||
@@ -58,7 +58,7 @@ class UUID:
|
||||
def version(self) -> str: ...
|
||||
|
||||
def getnode() -> Int: ...
|
||||
def uuid1(node: Int=None, clock_seq: Int=None) -> UUID: ...
|
||||
def uuid1(node: Int=..., clock_seq: Int=...) -> UUID: ...
|
||||
def uuid3(namespace: UUID, name: str) -> UUID: ...
|
||||
def uuid4() -> UUID: ...
|
||||
def uuid5(namespace: UUID, name: str) -> UUID: ...
|
||||
|
||||
@@ -4,30 +4,30 @@
|
||||
|
||||
from typing import Any, List, TextIO, Union
|
||||
|
||||
def warn(message: Union[str, Warning], category: type = None,
|
||||
stacklevel: int = 1) -> None: ...
|
||||
def warn(message: Union[str, Warning], category: type = ...,
|
||||
stacklevel: int = ...) -> None: ...
|
||||
|
||||
def warn_explicit(message: Union[str, Warning], category: type, filename: str,
|
||||
lineno: int, module: str = None, registry: Any = None,
|
||||
module_globals: Any = None) -> None: ...
|
||||
lineno: int, module: str = ..., registry: Any = ...,
|
||||
module_globals: Any = ...) -> None: ...
|
||||
|
||||
# logging modifies showwarning => make it a variable.
|
||||
def _showwarning(message: str, category: type, filename: str, lineno: int,
|
||||
file: TextIO = None, line: str = None) -> None: ...
|
||||
file: TextIO = ..., line: str = ...) -> None: ...
|
||||
showwarning = _showwarning
|
||||
|
||||
def formatwarning(message: str, category: type, filename: str, lineno: int,
|
||||
line: str = None) -> None: ...
|
||||
def filterwarnings(action: str, message: str = '', category: type = Warning,
|
||||
module: str = '', lineno: int = 0,
|
||||
append: bool = False) -> None: ...
|
||||
def simplefilter(action: str, category: type = Warning, lineno: int = 0,
|
||||
append: bool = False) -> None: ...
|
||||
line: str = ...) -> None: ...
|
||||
def filterwarnings(action: str, message: str = ..., category: type = ...,
|
||||
module: str = ..., lineno: int = ...,
|
||||
append: bool = ...) -> None: ...
|
||||
def simplefilter(action: str, category: type = ..., lineno: int = ...,
|
||||
append: bool = ...) -> None: ...
|
||||
def resetwarnings() -> None: ...
|
||||
|
||||
class catch_warnings:
|
||||
# TODO record and module must be keyword arguments!
|
||||
# TODO type of module?
|
||||
def __init__(self, record: bool = False, module: Any = None) -> None: ...
|
||||
def __init__(self, record: bool = ..., module: Any = ...) -> None: ...
|
||||
def __enter__(self) -> List[Any]: ...
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
|
||||
@@ -17,7 +17,7 @@ class ReferenceType(Generic[_T]):
|
||||
...
|
||||
|
||||
def ref(o: _T, callback: Callable[[ReferenceType[_T]],
|
||||
Any] = None) -> ReferenceType[_T]: ...
|
||||
Any] = ...) -> ReferenceType[_T]: ...
|
||||
|
||||
# TODO callback
|
||||
def proxy(object: _T) -> _T: ...
|
||||
|
||||
@@ -6,9 +6,9 @@ from typing import Any
|
||||
|
||||
class Error(Exception): ...
|
||||
|
||||
def register(name, klass, instance=None, update_tryorder=1): ...
|
||||
def get(using=None): ...
|
||||
def open(url, new=0, autoraise=True): ...
|
||||
def register(name, klass, instance=..., update_tryorder=...): ...
|
||||
def get(using=...): ...
|
||||
def open(url, new=..., autoraise=...): ...
|
||||
def open_new(url): ...
|
||||
def open_new_tab(url): ...
|
||||
|
||||
@@ -16,8 +16,8 @@ class BaseBrowser:
|
||||
args = ... # type: Any
|
||||
name = ... # type: Any
|
||||
basename = ... # type: Any
|
||||
def __init__(self, name='') -> None: ...
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def __init__(self, name=...) -> None: ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
def open_new(self, url): ...
|
||||
def open_new_tab(self, url): ...
|
||||
|
||||
@@ -26,10 +26,10 @@ class GenericBrowser(BaseBrowser):
|
||||
args = ... # type: Any
|
||||
basename = ... # type: Any
|
||||
def __init__(self, name) -> None: ...
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
|
||||
class BackgroundBrowser(GenericBrowser):
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
|
||||
class UnixBrowser(BaseBrowser):
|
||||
raise_opts = ... # type: Any
|
||||
@@ -39,7 +39,7 @@ class UnixBrowser(BaseBrowser):
|
||||
remote_action = ... # type: Any
|
||||
remote_action_newwin = ... # type: Any
|
||||
remote_action_newtab = ... # type: Any
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
|
||||
class Mozilla(UnixBrowser):
|
||||
raise_opts = ... # type: Any
|
||||
@@ -80,19 +80,19 @@ class Elinks(UnixBrowser):
|
||||
redirect_stdout = ... # type: Any
|
||||
|
||||
class Konqueror(BaseBrowser):
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
|
||||
class Grail(BaseBrowser):
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
|
||||
class WindowsDefault(BaseBrowser):
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
|
||||
class MacOSX(BaseBrowser):
|
||||
name = ... # type: Any
|
||||
def __init__(self, name) -> None: ...
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
|
||||
class MacOSXOSAScript(BaseBrowser):
|
||||
def __init__(self, name) -> None: ...
|
||||
def open(self, url, new=0, autoraise=True): ...
|
||||
def open(self, url, new=..., autoraise=...): ...
|
||||
|
||||
@@ -10,5 +10,5 @@ XINCLUDE_FALLBACK = ... # type: Any
|
||||
|
||||
class FatalIncludeError(SyntaxError): ...
|
||||
|
||||
def default_loader(href, parse, encoding=None): ...
|
||||
def include(elem, loader=None): ...
|
||||
def default_loader(href, parse, encoding=...): ...
|
||||
def include(elem, loader=...): ...
|
||||
|
||||
@@ -6,7 +6,7 @@ from typing import Any
|
||||
|
||||
xpath_tokenizer_re = ... # type: Any
|
||||
|
||||
def xpath_tokenizer(pattern, namespaces=None): ...
|
||||
def xpath_tokenizer(pattern, namespaces=...): ...
|
||||
def get_parent_map(context): ...
|
||||
def prepare_child(next, token): ...
|
||||
def prepare_star(next, token): ...
|
||||
@@ -22,7 +22,7 @@ class _SelectorContext:
|
||||
root = ... # type: Any
|
||||
def __init__(self, root) -> None: ...
|
||||
|
||||
def iterfind(elem, path, namespaces=None): ...
|
||||
def find(elem, path, namespaces=None): ...
|
||||
def findall(elem, path, namespaces=None): ...
|
||||
def findtext(elem, path, default=None, namespaces=None): ...
|
||||
def iterfind(elem, path, namespaces=...): ...
|
||||
def find(elem, path, namespaces=...): ...
|
||||
def findall(elem, path, namespaces=...): ...
|
||||
def findtext(elem, path, default=..., namespaces=...): ...
|
||||
|
||||
@@ -44,14 +44,14 @@ class Element:
|
||||
def __sizeof__(self): ...
|
||||
|
||||
def SubElement(parent, tag, attrib=..., **extra): ...
|
||||
def Comment(text=None): ...
|
||||
def ProcessingInstruction(target, text=None): ...
|
||||
def Comment(text=...): ...
|
||||
def ProcessingInstruction(target, text=...): ...
|
||||
|
||||
PI = ... # type: Any
|
||||
|
||||
class QName:
|
||||
text = ... # type: Any
|
||||
def __init__(self, text_or_uri, tag=None) -> None: ...
|
||||
def __init__(self, text_or_uri, tag=...) -> None: ...
|
||||
def __hash__(self): ...
|
||||
def __le__(self, other): ...
|
||||
def __lt__(self, other): ...
|
||||
@@ -61,20 +61,20 @@ class QName:
|
||||
def __ne__(self, other): ...
|
||||
|
||||
class ElementTree:
|
||||
def __init__(self, element=None, file=None) -> None: ...
|
||||
def __init__(self, element=..., file=...) -> None: ...
|
||||
def getroot(self): ...
|
||||
def parse(self, source, parser=None): ...
|
||||
def iter(self, tag=None): ...
|
||||
def getiterator(self, tag=None): ...
|
||||
def find(self, path, namespaces=None): ...
|
||||
def findtext(self, path, default=None, namespaces=None): ...
|
||||
def findall(self, path, namespaces=None): ...
|
||||
def iterfind(self, path, namespaces=None): ...
|
||||
def write(self, file_or_filename, encoding=None, xml_declaration=None, default_namespace=None, method=None, *, short_empty_elements=True): ...
|
||||
def parse(self, source, parser=...): ...
|
||||
def iter(self, tag=...): ...
|
||||
def getiterator(self, tag=...): ...
|
||||
def find(self, path, namespaces=...): ...
|
||||
def findtext(self, path, default=..., namespaces=...): ...
|
||||
def findall(self, path, namespaces=...): ...
|
||||
def iterfind(self, path, namespaces=...): ...
|
||||
def write(self, file_or_filename, encoding=..., xml_declaration=..., default_namespace=..., method=..., *, short_empty_elements=...): ...
|
||||
def write_c14n(self, file): ...
|
||||
|
||||
def register_namespace(prefix, uri): ...
|
||||
def tostring(element, encoding=None, method=None, *, short_empty_elements=True): ...
|
||||
def tostring(element, encoding=..., method=..., *, short_empty_elements=...): ...
|
||||
|
||||
class _ListDataStream(io.BufferedIOBase):
|
||||
lst = ... # type: Any
|
||||
@@ -84,32 +84,32 @@ class _ListDataStream(io.BufferedIOBase):
|
||||
def write(self, b): ...
|
||||
def tell(self): ...
|
||||
|
||||
def tostringlist(element, encoding=None, method=None, *, short_empty_elements=True): ...
|
||||
def tostringlist(element, encoding=..., method=..., *, short_empty_elements=...): ...
|
||||
def dump(elem): ...
|
||||
def parse(source, parser=None): ...
|
||||
def iterparse(source, events=None, parser=None): ...
|
||||
def parse(source, parser=...): ...
|
||||
def iterparse(source, events=..., parser=...): ...
|
||||
|
||||
class XMLPullParser:
|
||||
def __init__(self, events=None, *, _parser=None) -> None: ...
|
||||
def __init__(self, events=..., *, _parser=...) -> None: ...
|
||||
def feed(self, data): ...
|
||||
def close(self): ...
|
||||
def read_events(self): ...
|
||||
|
||||
class _IterParseIterator:
|
||||
root = ... # type: Any
|
||||
def __init__(self, source, events, parser, close_source=False) -> None: ...
|
||||
def __init__(self, source, events, parser, close_source=...) -> None: ...
|
||||
def __next__(self): ...
|
||||
def __iter__(self): ...
|
||||
|
||||
def XML(text, parser=None): ...
|
||||
def XMLID(text, parser=None): ...
|
||||
def XML(text, parser=...): ...
|
||||
def XMLID(text, parser=...): ...
|
||||
|
||||
fromstring = ... # type: Any
|
||||
|
||||
def fromstringlist(sequence, parser=None): ...
|
||||
def fromstringlist(sequence, parser=...): ...
|
||||
|
||||
class TreeBuilder:
|
||||
def __init__(self, element_factory=None) -> None: ...
|
||||
def __init__(self, element_factory=...) -> None: ...
|
||||
def close(self): ...
|
||||
def data(self, data): ...
|
||||
def start(self, tag, attrs): ...
|
||||
|
||||
@@ -14,16 +14,16 @@ class ZipInfo:
|
||||
file_size = 0
|
||||
|
||||
class ZipFile:
|
||||
def __init__(self, file: Union[str, BinaryIO], mode: str = 'r',
|
||||
compression: int = ZIP_STORED,
|
||||
allowZip64: bool = False) -> None: ...
|
||||
def __init__(self, file: Union[str, BinaryIO], mode: str = ...,
|
||||
compression: int = ...,
|
||||
allowZip64: bool = ...) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def getinfo(name: str) -> ZipInfo: ...
|
||||
def infolist(self) -> List[ZipInfo]: ...
|
||||
def namelist(self) -> List[str]: ...
|
||||
def read(self, name: Union[str, ZipInfo], pwd: str = None) -> bytes: ...
|
||||
def write(self, filename: str, arcname: str = None,
|
||||
compress_type: int = None) -> None: ...
|
||||
def read(self, name: Union[str, ZipInfo], pwd: str = ...) -> bytes: ...
|
||||
def write(self, filename: str, arcname: str = ...,
|
||||
compress_type: int = ...) -> None: ...
|
||||
|
||||
def __enter__(self) -> 'ZipFile': ...
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user