mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-05 09:27:38 +08:00
Consistently use '= ...' for optional parameters.
This commit is contained in:
@@ -15,7 +15,7 @@ _T2 = TypeVar('_T2')
|
||||
|
||||
class deque(Generic[_T]):
|
||||
maxlen = ... # type: Optional[int]
|
||||
def __init__(self, iterable: Iterator[_T] = None, maxlen: int = None) -> None: ...
|
||||
def __init__(self, iterable: Iterator[_T] = ..., maxlen: int = ...) -> None: ...
|
||||
def append(self, x: _T) -> None: ...
|
||||
def appendleft(self, x: _T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
|
||||
@@ -10,4 +10,4 @@ class MD5Type(object):
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
def new(arg: str = None) -> MD5Type: ...
|
||||
def new(arg: str = ...) -> MD5Type: ...
|
||||
|
||||
@@ -4,8 +4,8 @@ from typing import Tuple
|
||||
_State = Tuple[int, ...]
|
||||
|
||||
class Random(object):
|
||||
def __init__(self, seed: object = None) -> None: ...
|
||||
def seed(self, x: object = None) -> None: ...
|
||||
def __init__(self, seed: object = ...) -> None: ...
|
||||
def seed(self, x: object = ...) -> None: ...
|
||||
def getstate(self) -> _State: ...
|
||||
def setstate(self, state: _State) -> None: ...
|
||||
def random(self) -> float: ...
|
||||
|
||||
@@ -12,4 +12,4 @@ class sha(object): # not actually exposed
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
def new(arg: str = None) -> sha: ...
|
||||
def new(arg: str = ...) -> sha: ...
|
||||
|
||||
@@ -5,12 +5,12 @@ from typing import Optional
|
||||
def a2b_base64(string: str) -> str: ...
|
||||
def a2b_hex(hexstr: str) -> str: ...
|
||||
def a2b_hqx(string: str) -> str: ...
|
||||
def a2b_qp(string: str, header: bool = None) -> str: ...
|
||||
def a2b_qp(string: str, header: bool = ...) -> str: ...
|
||||
def a2b_uu(string: str) -> str: ...
|
||||
def b2a_base64(data: str) -> str: ...
|
||||
def b2a_hex(data: str) -> str: ...
|
||||
def b2a_hqx(data: str) -> str: ...
|
||||
def b2a_qp(data: str, quotetabs: bool = None, istext: bool = None, header: bool = None) -> str: ...
|
||||
def b2a_qp(data: str, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> str: ...
|
||||
def b2a_uu(data: str) -> str: ...
|
||||
def crc32(data: str, crc: Optional[int]) -> int: ...
|
||||
def crc_hqx(data: str, oldcrc: int) -> int: ...
|
||||
|
||||
@@ -7,8 +7,8 @@ format_version = ... # type: str
|
||||
class Pickler: ...
|
||||
class Unpickler: ...
|
||||
|
||||
def dump(obj: Any, file: IO[str], protocol: int = None) -> None: ...
|
||||
def dumps(obj: Any, protocol: int = None) -> str: ...
|
||||
def dump(obj: Any, file: IO[str], protocol: int = ...) -> None: ...
|
||||
def dumps(obj: Any, protocol: int = ...) -> str: ...
|
||||
def load(file: IO[str]) -> Any: ...
|
||||
def loads(str: str) -> Any: ...
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ class InputType(IO[str], Iterator[str]):
|
||||
def closed(self) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, size: int = -1) -> str: ...
|
||||
def readline(self, size: int = -1) -> str: ...
|
||||
def readlines(self, hint: int = -1) -> List[str]: ...
|
||||
def read(self, size: int = ...) -> str: ...
|
||||
def readline(self, size: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = ...) -> Optional[int]: ...
|
||||
@@ -32,9 +32,9 @@ class OutputType(IO[str], Iterator[str]):
|
||||
def closed(self) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, size: int = -1) -> str: ...
|
||||
def readline(self, size: int = -1) -> str: ...
|
||||
def readlines(self, hint: int = -1) -> List[str]: ...
|
||||
def read(self, size: int = ...) -> str: ...
|
||||
def readline(self, size: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = ...) -> Optional[int]: ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class timezone(tzinfo):
|
||||
min = ... # type: tzinfo
|
||||
max = ... # type: tzinfo
|
||||
|
||||
def __init__(self, offset: timedelta, name: str = '') -> None: ...
|
||||
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
_tzinfo = tzinfo
|
||||
@@ -29,7 +29,7 @@ class date(object):
|
||||
max = ... # type: date
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = None, day: int = None) -> None: ...
|
||||
def __init__(self, year: int, month: int = ..., day: int = ...) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float) -> date: ...
|
||||
@@ -51,7 +51,7 @@ class date(object):
|
||||
def isoformat(self) -> str: ...
|
||||
def timetuple(self) -> tuple: ... # TODO return type
|
||||
def toordinal(self) -> int: ...
|
||||
def replace(self, year: int = None, month: int = None, day: int = None) -> date: ...
|
||||
def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ...
|
||||
def __le__(self, other: date) -> bool: ...
|
||||
def __lt__(self, other: date) -> bool: ...
|
||||
def __ge__(self, other: date) -> bool: ...
|
||||
@@ -71,8 +71,8 @@ class time:
|
||||
max = ... # type: time
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, hour: int = 0, minute: int = 0, second: int = 0, microsecond: int = 0,
|
||||
tzinfo: tzinfo = None) -> None: ...
|
||||
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def hour(self) -> int: ...
|
||||
@@ -96,8 +96,8 @@ class time:
|
||||
def utcoffset(self) -> Optional[int]: ...
|
||||
def tzname(self) -> Optional[str]: ...
|
||||
def dst(self) -> Optional[int]: ...
|
||||
def replace(self, hour: int = None, minute: int = None, second: int = None,
|
||||
microsecond: int = None, tzinfo: Union[_tzinfo, bool] = True) -> time: ...
|
||||
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
|
||||
microsecond: int = ..., tzinfo: Union[_tzinfo, bool] = ...) -> time: ...
|
||||
|
||||
_date = date
|
||||
_time = time
|
||||
@@ -107,9 +107,9 @@ class timedelta(SupportsAbs[timedelta]):
|
||||
max = ... # type: timedelta
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, days: int = 0, seconds: int = 0, microseconds: int = 0,
|
||||
milliseconds: int = 0, minutes: int = 0, hours: int = 0,
|
||||
weeks: int = 0) -> None: ...
|
||||
def __init__(self, days: int = ..., seconds: int = ..., microseconds: int = ...,
|
||||
milliseconds: int = ..., minutes: int = ..., hours: int = ...,
|
||||
weeks: int = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def days(self) -> int: ...
|
||||
@@ -150,9 +150,9 @@ class datetime(object):
|
||||
max = ... # type: datetime
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = None, day: int = None, hour: int = None,
|
||||
minute: int = None, second: int = None, microseconds: int = None,
|
||||
tzinfo: tzinfo = None) -> None: ...
|
||||
def __init__(self, year: int, month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microseconds: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@@ -172,7 +172,7 @@ class datetime(object):
|
||||
def tzinfo(self) -> _tzinfo: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float, tz: timezone = None) -> datetime: ...
|
||||
def fromtimestamp(cls, t: float, tz: timezone = ...) -> datetime: ...
|
||||
@classmethod
|
||||
def utcfromtimestamp(cls, t: float) -> datetime: ...
|
||||
@classmethod
|
||||
@@ -180,7 +180,7 @@ class datetime(object):
|
||||
@classmethod
|
||||
def fromordinal(cls, n: int) -> datetime: ...
|
||||
@classmethod
|
||||
def now(cls, tz: timezone = None) -> datetime: ...
|
||||
def now(cls, tz: timezone = ...) -> datetime: ...
|
||||
@classmethod
|
||||
def utcnow(cls) -> datetime: ...
|
||||
@classmethod
|
||||
@@ -195,12 +195,12 @@ class datetime(object):
|
||||
def date(self) -> _date: ...
|
||||
def time(self) -> _time: ...
|
||||
def timetz(self) -> _time: ...
|
||||
def replace(self, year: int = None, month: int = None, day: int = None, hour: int = None,
|
||||
minute: int = None, second: int = None, microsecond: int = None, tzinfo:
|
||||
Union[_tzinfo, bool] = True) -> datetime: ...
|
||||
def astimezone(self, tz: timezone = None) -> datetime: ...
|
||||
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
|
||||
Union[_tzinfo, bool] = ...) -> datetime: ...
|
||||
def astimezone(self, tz: timezone = ...) -> datetime: ...
|
||||
def ctime(self) -> str: ...
|
||||
def isoformat(self, sep: str = 'T') -> str: ...
|
||||
def isoformat(self, sep: str = ...) -> str: ...
|
||||
@classmethod
|
||||
def strptime(cls, date_string: str, format: str) -> datetime: ...
|
||||
def utcoffset(self) -> Optional[int]: ...
|
||||
|
||||
@@ -74,12 +74,12 @@ LOCK_WRITE = ... # type: int
|
||||
|
||||
_ANYFILE = Union[int, io.IOBase]
|
||||
|
||||
def fcntl(fd: _ANYFILE, op: int, arg: Union[int, str] = 0) -> Union[int, str]: ...
|
||||
def fcntl(fd: _ANYFILE, op: int, arg: Union[int, str] = ...) -> Union[int, str]: ...
|
||||
|
||||
# TODO: arg: int or read-only buffer interface or read-write buffer interface
|
||||
def ioctl(fd: _ANYFILE, op: int, arg: Union[int, str] = 0,
|
||||
mutate_flag: bool = True) -> Union[int, str]: ...
|
||||
def ioctl(fd: _ANYFILE, op: int, arg: Union[int, str] = ...,
|
||||
mutate_flag: bool = ...) -> Union[int, str]: ...
|
||||
|
||||
def flock(fd: _ANYFILE, op: int) -> None: ...
|
||||
def lockf(fd: _ANYFILE, op: int, length: int = 0, start: int = 0,
|
||||
whence: int = 0) -> Union[int, str]: ...
|
||||
def lockf(fd: _ANYFILE, op: int, length: int = ..., start: int = ...,
|
||||
whence: int = ...) -> Union[int, str]: ...
|
||||
|
||||
@@ -5,11 +5,11 @@ from typing import List, Any, Tuple
|
||||
def enable() -> None: ...
|
||||
def disable() -> None: ...
|
||||
def isenabled() -> bool: ...
|
||||
def collect(generation: int = None) -> int: ...
|
||||
def collect(generation: int = ...) -> int: ...
|
||||
def set_debug(flags: int) -> None: ...
|
||||
def get_debug() -> int: ...
|
||||
def get_objects() -> List[Any]: ...
|
||||
def set_threshold(threshold0: int, threshold1: int = None, threshold2: int = None) -> None: ...
|
||||
def set_threshold(threshold0: int, threshold1: int = ..., threshold2: int = ...) -> None: ...
|
||||
def get_count() -> Tuple[int, int, int]: ...
|
||||
def get_threshold() -> Tuple[int, int, int]: ...
|
||||
def get_referrers(*objs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -15,21 +15,21 @@ PY_SOURCE = ... # type: int
|
||||
SEARCH_ERROR = ... # type: int
|
||||
|
||||
def acquire_lock() -> None: ...
|
||||
def find_module(name: str, path: Iterable[str] = None) -> Optional[Tuple[str, str, Tuple[str, str, int]]]: ...
|
||||
def find_module(name: str, path: Iterable[str] = ...) -> Optional[Tuple[str, str, Tuple[str, str, int]]]: ...
|
||||
def get_magic() -> str: ...
|
||||
def get_suffixes() -> List[Tuple[str, str, int]]: ...
|
||||
def init_builtin(name: str) -> types.ModuleType: ...
|
||||
def init_frozen(name: str) -> types.ModuleType: ...
|
||||
def is_builtin(name: str) -> int: ...
|
||||
def is_frozen(name: str) -> bool: ...
|
||||
def load_compiled(name: str, pathname: str, file: IO[Any] = None) -> types.ModuleType: ...
|
||||
def load_dynamic(name: str, pathname: str, file: IO[Any] = None) -> types.ModuleType: ...
|
||||
def load_compiled(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ...
|
||||
def load_dynamic(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ...
|
||||
def load_module(name: str, file: str, pathname: str, description: Tuple[str, str, int]) -> types.ModuleType: ...
|
||||
def load_source(name: str, pathname: str, file: IO[Any] = None) -> types.ModuleType: ...
|
||||
def load_source(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ...
|
||||
def lock_held() -> bool: ...
|
||||
def new_module(name: str) -> types.ModuleType: ...
|
||||
def release_lock() -> None: ...
|
||||
|
||||
class NullImporter:
|
||||
def __init__(self, path_string: str) -> None: ...
|
||||
def find_module(fullname: str, path: str = None) -> None: ...
|
||||
def find_module(fullname: str, path: str = ...) -> None: ...
|
||||
|
||||
@@ -8,8 +8,8 @@ from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple,
|
||||
_T = TypeVar('_T')
|
||||
_S = TypeVar('_S')
|
||||
|
||||
def count(start: int = 0,
|
||||
step: int = 1) -> Iterator[int]: ... # more general types?
|
||||
def count(start: int = ...,
|
||||
step: int = ...) -> Iterator[int]: ... # more general types?
|
||||
def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
def repeat(object: _T, times: int = ...) -> Iterator[_T]: ...
|
||||
@@ -35,7 +35,7 @@ def groupby(iterable: Iterable[_T],
|
||||
def islice(iterable: Iterable[_T], stop: int) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def islice(iterable: Iterable[_T], start: int, stop: int,
|
||||
step: int = 1) -> Iterator[_T]: ...
|
||||
step: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
_T1 = TypeVar('_T1')
|
||||
_T2 = TypeVar('_T2')
|
||||
@@ -52,7 +52,7 @@ def imap(func: Callable[[_T1, _T2], _S],
|
||||
def starmap(func: Any, iterable: Iterable[Any]) -> Iterator[Any]: ...
|
||||
def takewhile(predicate: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def tee(iterable: Iterable[Any], n: int = 2) -> Iterator[Any]: ...
|
||||
def tee(iterable: Iterable[Any], n: int = ...) -> Iterator[Any]: ...
|
||||
|
||||
@overload
|
||||
def izip(iter1: Iterable[_T1]) -> Iterable[Tuple[_T1]]: ...
|
||||
@@ -67,14 +67,14 @@ def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> Iterable[Tuple[_T1, _T2,
|
||||
_T3, _T4]]: ... # TODO more than four iterables
|
||||
def izip_longest(*p: Iterable[Any],
|
||||
fillvalue: Any = None) -> Iterator[Any]: ...
|
||||
fillvalue: Any = ...) -> Iterator[Any]: ...
|
||||
|
||||
# TODO: Return type should be Iterator[Tuple[..]], but unknown tuple shape.
|
||||
# Iterator[Sequence[_T]] loses this type information.
|
||||
def product(*p: Iterable[_T], repeat: int = 1) -> Iterator[Sequence[_T]]: ...
|
||||
def product(*p: Iterable[_T], repeat: int = ...) -> Iterator[Sequence[_T]]: ...
|
||||
|
||||
def permutations(iterable: Iterable[_T],
|
||||
r: int = None) -> Iterator[Sequence[_T]]: ...
|
||||
r: int = ...) -> Iterator[Sequence[_T]]: ...
|
||||
def combinations(iterable: Iterable[_T],
|
||||
r: int) -> Iterable[Sequence[_T]]: ...
|
||||
def combinations_with_replacement(iterable: Iterable[_T],
|
||||
|
||||
@@ -17,17 +17,17 @@ struct_time = NamedTuple('struct_time',
|
||||
|
||||
_TIME_TUPLE = Tuple[int, int, int, int, int, int, int, int, int]
|
||||
|
||||
def asctime(t: struct_time = None) -> str:
|
||||
def asctime(t: struct_time = ...) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def clock() -> float: ...
|
||||
|
||||
def ctime(secs: float = None) -> str:
|
||||
def ctime(secs: float = ...) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def gmtime(secs: float = None) -> struct_time: ...
|
||||
def gmtime(secs: float = ...) -> struct_time: ...
|
||||
|
||||
def localtime(secs: float = None) -> struct_time: ...
|
||||
def localtime(secs: float = ...) -> struct_time: ...
|
||||
|
||||
def mktime(t: struct_time) -> float:
|
||||
raise OverflowError()
|
||||
@@ -35,11 +35,11 @@ def mktime(t: struct_time) -> float:
|
||||
|
||||
def sleep(secs: float) -> None: ...
|
||||
|
||||
def strftime(format: str, t: struct_time = None) -> str:
|
||||
def strftime(format: str, t: struct_time = ...) -> str:
|
||||
raise MemoryError()
|
||||
raise ValueError()
|
||||
|
||||
def strptime(string: str, format: str = "%a %b %d %H:%M:%S %Y") -> struct_time:
|
||||
def strptime(string: str, format: str = ...) -> struct_time:
|
||||
raise ValueError()
|
||||
|
||||
def time() -> float:
|
||||
|
||||
@@ -2,7 +2,7 @@ from typing import Any, IO
|
||||
|
||||
version = ... # type: int
|
||||
|
||||
def dump(value: Any, file: IO[Any], version: int = None) -> None: ...
|
||||
def dump(value: Any, file: IO[Any], version: int = ...) -> None: ...
|
||||
def load(file: IO[Any]) -> Any: ...
|
||||
def dumps(value: Any, version: int = None) -> str: ...
|
||||
def dumps(value: Any, version: int = ...) -> str: ...
|
||||
def loads(string: str) -> Any: ...
|
||||
|
||||
@@ -13,12 +13,12 @@ class _IOBase:
|
||||
def flush(self): ...
|
||||
def isatty(self): ...
|
||||
def readable(self): ...
|
||||
def readline(self, size: int = -1): ...
|
||||
def readlines(self, hint: int = -1): ...
|
||||
def readline(self, size: int = ...): ...
|
||||
def readlines(self, hint: int = ...): ...
|
||||
def seek(self, offset, whence=...): ...
|
||||
def seekable(self): ...
|
||||
def tell(self): ...
|
||||
def truncate(self, size: int = None) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self): ...
|
||||
def writelines(self, lines): ...
|
||||
def __del__(self): ...
|
||||
@@ -29,13 +29,13 @@ class _IOBase:
|
||||
|
||||
class _BufferedIOBase(_IOBase):
|
||||
def detach(self): ...
|
||||
def read(self, size: int = -1): ...
|
||||
def read1(self, size: int = -1): ...
|
||||
def read(self, size: int = ...): ...
|
||||
def read1(self, size: int = ...): ...
|
||||
def readinto(self, b): ...
|
||||
def write(self, b): ...
|
||||
|
||||
class _RawIOBase(_IOBase):
|
||||
def read(self, size: int = -1): ...
|
||||
def read(self, size: int = ...): ...
|
||||
def readall(self): ...
|
||||
|
||||
class _TextIOBase(_IOBase):
|
||||
@@ -43,6 +43,6 @@ class _TextIOBase(_IOBase):
|
||||
errors = ... # type: Any
|
||||
newlines = ... # type: Any
|
||||
def detach(self): ...
|
||||
def read(self, size: int = -1): ...
|
||||
def readline(self, size: int = -1): ...
|
||||
def read(self, size: int = ...): ...
|
||||
def readline(self, size: int = ...): ...
|
||||
def write(self, b): ...
|
||||
|
||||
@@ -76,7 +76,7 @@ def dgettext(domain, msg): ...
|
||||
def gettext(msg): ...
|
||||
def localeconv(): ...
|
||||
def nl_langinfo(key): ...
|
||||
def setlocale(category: int, locale: Iterable[str] = None) -> str: ...
|
||||
def setlocale(category: int, locale: Iterable[str] = ...) -> str: ...
|
||||
def strcoll(string1, string2) -> int: ...
|
||||
def strxfrm(string): ...
|
||||
def textdomain(domain): ...
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
from typing import Any
|
||||
|
||||
class Random:
|
||||
def seed(self, x: Any = None) -> None: ...
|
||||
def seed(self, x: Any = ...) -> None: ...
|
||||
def getstate(self) -> tuple: ...
|
||||
def setstate(self, state: tuple) -> None: ...
|
||||
def random(self) -> float: ...
|
||||
|
||||
@@ -8,7 +8,7 @@ typecodes = ... # type: str
|
||||
|
||||
class array:
|
||||
def __init__(self, typecode: str,
|
||||
initializer: Iterable[Any] = None) -> None:
|
||||
initializer: Iterable[Any] = ...) -> None:
|
||||
typecode = ... # type: str
|
||||
itemsize = 0
|
||||
|
||||
@@ -24,7 +24,7 @@ class array:
|
||||
def fromunicode(self, s: str) -> None: ...
|
||||
def index(self, x: Any) -> int: ...
|
||||
def insert(self, i: int, x: Any) -> None: ...
|
||||
def pop(self, i: int = -1) -> Any: ...
|
||||
def pop(self, i: int = ...) -> Any: ...
|
||||
def remove(self, x: Any) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def tobytes(self) -> bytes: ...
|
||||
|
||||
@@ -8,15 +8,15 @@ def a2b_uu(string: bytes) -> bytes: ...
|
||||
def b2a_uu(data: bytes) -> bytes: ...
|
||||
def a2b_base64(string: bytes) -> bytes: ...
|
||||
def b2a_base64(data: bytes) -> bytes: ...
|
||||
def a2b_qp(string: bytes, header: bool = False) -> bytes: ...
|
||||
def b2a_qp(data: bytes, quotetabs: bool = False, istext: bool = True,
|
||||
header: bool = False) -> bytes: ...
|
||||
def a2b_qp(string: bytes, header: bool = ...) -> bytes: ...
|
||||
def b2a_qp(data: bytes, quotetabs: bool = ..., istext: bool = ...,
|
||||
header: bool = ...) -> bytes: ...
|
||||
def a2b_hqx(string: bytes) -> bytes: ...
|
||||
def rledecode_hqx(data: bytes) -> bytes: ...
|
||||
def rlecode_hqx(data: bytes) -> bytes: ...
|
||||
def b2a_hqx(data: bytes) -> bytes: ...
|
||||
def crc_hqx(data: bytes, crc: int) -> int: ...
|
||||
def crc32(data: bytes, crc: int = None) -> int: ...
|
||||
def crc32(data: bytes, crc: int = ...) -> int: ...
|
||||
def b2a_hex(data: bytes) -> bytes: ...
|
||||
def hexlify(data: bytes) -> bytes: ...
|
||||
def a2b_hex(hexstr: bytes) -> bytes: ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class timezone(tzinfo):
|
||||
min = ... # type: tzinfo
|
||||
max = ... # type: tzinfo
|
||||
|
||||
def __init__(self, offset: timedelta, name: str = '') -> None: ...
|
||||
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
_tzinfo = tzinfo
|
||||
@@ -29,7 +29,7 @@ class date:
|
||||
max = ... # type: date
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = None, day: int = None) -> None: ...
|
||||
def __init__(self, year: int, month: int = ..., day: int = ...) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float) -> date: ...
|
||||
@@ -51,7 +51,7 @@ class date:
|
||||
def isoformat(self) -> str: ...
|
||||
def timetuple(self) -> tuple: ... # TODO return type
|
||||
def toordinal(self) -> int: ...
|
||||
def replace(self, year: int = None, month: int = None, day: int = None) -> date: ...
|
||||
def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ...
|
||||
def __le__(self, other: date) -> bool: ...
|
||||
def __lt__(self, other: date) -> bool: ...
|
||||
def __ge__(self, other: date) -> bool: ...
|
||||
@@ -71,8 +71,8 @@ class time:
|
||||
max = ... # type: time
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, hour: int = 0, minute: int = 0, second: int = 0, microsecond: int = 0,
|
||||
tzinfo: tzinfo = None) -> None: ...
|
||||
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def hour(self) -> int: ...
|
||||
@@ -96,8 +96,8 @@ class time:
|
||||
def utcoffset(self) -> Optional[int]: ...
|
||||
def tzname(self) -> Optional[str]: ...
|
||||
def dst(self) -> Optional[int]: ...
|
||||
def replace(self, hour: int = None, minute: int = None, second: int = None,
|
||||
microsecond: int = None, tzinfo: Union[_tzinfo, bool] = True) -> time: ...
|
||||
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
|
||||
microsecond: int = ..., tzinfo: Union[_tzinfo, bool] = ...) -> time: ...
|
||||
|
||||
_date = date
|
||||
_time = time
|
||||
@@ -107,9 +107,9 @@ class timedelta(SupportsAbs[timedelta]):
|
||||
max = ... # type: timedelta
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, days: int = 0, seconds: int = 0, microseconds: int = 0,
|
||||
milliseconds: int = 0, minutes: int = 0, hours: int = 0,
|
||||
weeks: int = 0) -> None: ...
|
||||
def __init__(self, days: int = ..., seconds: int = ..., microseconds: int = ...,
|
||||
milliseconds: int = ..., minutes: int = ..., hours: int = ...,
|
||||
weeks: int = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def days(self) -> int: ...
|
||||
@@ -151,9 +151,9 @@ class datetime:
|
||||
max = ... # type: datetime
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = None, day: int = None, hour: int = None,
|
||||
minute: int = None, second: int = None, microsecond: int = None,
|
||||
tzinfo: tzinfo = None) -> None: ...
|
||||
def __init__(self, year: int, month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@@ -173,7 +173,7 @@ class datetime:
|
||||
def tzinfo(self) -> _tzinfo: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float, tz: timezone = None) -> datetime: ...
|
||||
def fromtimestamp(cls, t: float, tz: timezone = ...) -> datetime: ...
|
||||
@classmethod
|
||||
def utcfromtimestamp(cls, t: float) -> datetime: ...
|
||||
@classmethod
|
||||
@@ -181,7 +181,7 @@ class datetime:
|
||||
@classmethod
|
||||
def fromordinal(cls, n: int) -> datetime: ...
|
||||
@classmethod
|
||||
def now(cls, tz: timezone = None) -> datetime: ...
|
||||
def now(cls, tz: timezone = ...) -> datetime: ...
|
||||
@classmethod
|
||||
def utcnow(cls) -> datetime: ...
|
||||
@classmethod
|
||||
@@ -195,12 +195,12 @@ class datetime:
|
||||
def date(self) -> _date: ...
|
||||
def time(self) -> _time: ...
|
||||
def timetz(self) -> _time: ...
|
||||
def replace(self, year: int = None, month: int = None, day: int = None, hour: int = None,
|
||||
minute: int = None, second: int = None, microsecond: int = None, tzinfo:
|
||||
Union[_tzinfo, bool] = True) -> datetime: ...
|
||||
def astimezone(self, tz: timezone = None) -> datetime: ...
|
||||
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
|
||||
Union[_tzinfo, bool] = ...) -> datetime: ...
|
||||
def astimezone(self, tz: timezone = ...) -> datetime: ...
|
||||
def ctime(self) -> str: ...
|
||||
def isoformat(self, sep: str = 'T') -> str: ...
|
||||
def isoformat(self, sep: str = ...) -> str: ...
|
||||
@classmethod
|
||||
def strptime(cls, date_string: str, format: str) -> datetime: ...
|
||||
def utcoffset(self) -> Optional[int]: ...
|
||||
|
||||
@@ -8,4 +8,4 @@ FD_CLOEXEC = 0
|
||||
F_GETFD = 0
|
||||
F_SETFD = 0
|
||||
|
||||
def fcntl(fd: int, op: int, arg: int = 0) -> int: ...
|
||||
def fcntl(fd: int, op: int, arg: int = ...) -> int: ...
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import typing
|
||||
|
||||
def collect(generation: int = -1) -> int: ...
|
||||
def collect(generation: int = ...) -> int: ...
|
||||
def disable() -> None: ...
|
||||
def enable() -> None: ...
|
||||
def isenabled() -> bool: ...
|
||||
|
||||
@@ -6,5 +6,5 @@ from typing import TypeVar
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
def cache_from_source(path: str, debug_override: bool = None) -> str: ...
|
||||
def cache_from_source(path: str, debug_override: bool = ...) -> str: ...
|
||||
def reload(module: _T) -> _T: ... # TODO imprecise signature
|
||||
|
||||
@@ -8,8 +8,8 @@ from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple,
|
||||
_T = TypeVar('_T')
|
||||
_S = TypeVar('_S')
|
||||
|
||||
def count(start: int = 0,
|
||||
step: int = 1) -> Iterator[int]: ... # more general types?
|
||||
def count(start: int = ...,
|
||||
step: int = ...) -> Iterator[int]: ... # more general types?
|
||||
def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
@overload
|
||||
@@ -36,21 +36,21 @@ def groupby(iterable: Iterable[_T],
|
||||
def islice(iterable: Iterable[_T], stop: int) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def islice(iterable: Iterable[_T], start: int, stop: int,
|
||||
step: int = 1) -> Iterator[_T]: ...
|
||||
step: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
def starmap(func: Any, iterable: Iterable[Any]) -> Iterator[Any]: ...
|
||||
def takewhile(predicate: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def tee(iterable: Iterable[Any], n: int = 2) -> Iterator[Any]: ...
|
||||
def tee(iterable: Iterable[Any], n: int = ...) -> Iterator[Any]: ...
|
||||
def zip_longest(*p: Iterable[Any],
|
||||
fillvalue: Any = None) -> Iterator[Any]: ...
|
||||
fillvalue: Any = ...) -> Iterator[Any]: ...
|
||||
|
||||
# TODO: Return type should be Iterator[Tuple[..]], but unknown tuple shape.
|
||||
# Iterator[Sequence[_T]] loses this type information.
|
||||
def product(*p: Iterable[_T], repeat: int = 1) -> Iterator[Sequence[_T]]: ...
|
||||
def product(*p: Iterable[_T], repeat: int = ...) -> Iterator[Sequence[_T]]: ...
|
||||
|
||||
def permutations(iterable: Iterable[_T],
|
||||
r: Union[int, None] = None) -> Iterator[Sequence[_T]]: ...
|
||||
r: Union[int, None] = ...) -> Iterator[Sequence[_T]]: ...
|
||||
def combinations(iterable: Iterable[_T],
|
||||
r: int) -> Iterable[Sequence[_T]]: ...
|
||||
def combinations_with_replacement(iterable: Iterable[_T],
|
||||
|
||||
@@ -16,12 +16,12 @@ POLLNVAL = 0
|
||||
class poll:
|
||||
def __init__(self) -> None: ...
|
||||
def register(self, fd: Any,
|
||||
eventmask: int = POLLIN|POLLPRI|POLLOUT) -> None: ...
|
||||
eventmask: int = ...) -> None: ...
|
||||
def modify(self, fd: Any, eventmask: int) -> None: ...
|
||||
def unregister(self, fd: Any) -> None: ...
|
||||
def poll(self, timeout: int = None) -> List[Tuple[int, int]]: ...
|
||||
def poll(self, timeout: int = ...) -> List[Tuple[int, int]]: ...
|
||||
|
||||
def select(rlist: Sequence, wlist: Sequence, xlist: Sequence,
|
||||
timeout: float = None) -> Tuple[List[int],
|
||||
timeout: float = ...) -> Tuple[List[int],
|
||||
List[int],
|
||||
List[int]]: ...
|
||||
|
||||
@@ -37,15 +37,15 @@ class struct_time:
|
||||
# ----- functions -----
|
||||
def asctime(t: Union[Tuple[int, int, int, int, int, int, int, int, int],
|
||||
struct_time,
|
||||
None] = None) -> str: ... # return current time
|
||||
None] = ...) -> str: ... # return current time
|
||||
|
||||
def clock() -> float: ...
|
||||
|
||||
def ctime(secs: Union[float, None] = None) -> str: ... # return current time
|
||||
def ctime(secs: Union[float, None] = ...) -> str: ... # return current time
|
||||
|
||||
def gmtime(secs: Union[float, None] = None) -> struct_time: ... # return current time
|
||||
def gmtime(secs: Union[float, None] = ...) -> struct_time: ... # return current time
|
||||
|
||||
def localtime(secs: Union[float, None] = None) -> struct_time: ... # return current time
|
||||
def localtime(secs: Union[float, None] = ...) -> struct_time: ... # return current time
|
||||
|
||||
def mktime(t: Union[Tuple[int, int, int, int, int,
|
||||
int, int, int, int],
|
||||
@@ -56,9 +56,9 @@ def sleep(secs: Union[int, float]) -> None: ...
|
||||
def strftime(format: str, t: Union[Tuple[int, int, int, int, int,
|
||||
int, int, int, int],
|
||||
struct_time,
|
||||
None] = None) -> str: ... # return current time
|
||||
None] = ...) -> str: ... # return current time
|
||||
|
||||
def strptime(string: str,
|
||||
format: str = "%a %b %d %H:%M:%S %Y") -> struct_time: ...
|
||||
format: str = ...) -> struct_time: ...
|
||||
def time() -> float: ...
|
||||
def tzset() -> None: ... # Unix only
|
||||
|
||||
@@ -22,7 +22,7 @@ Z_NO_FLUSH = ... # type: int
|
||||
Z_SYNC_FLUSH = ... # type: int
|
||||
|
||||
def adler32(data, value=...) -> int: ...
|
||||
def compress(data, level: int = 6): ...
|
||||
def compress(data, level: int = ...): ...
|
||||
def compressobj(level=..., method=..., wbits=..., memlevel=...,
|
||||
strategy=..., zdict=...): ...
|
||||
def crc32(data, value=...) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user