mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-02 01:23:24 +08:00
Change numerous default values to ... (#1722)
This is the convention, and some default values (e.g. strings) apparently break pytype.
This commit is contained in:
committed by
Matthias Kramm
parent
66821993f6
commit
54dd6ba27c
@@ -181,7 +181,7 @@ class float(SupportsFloat, SupportsInt, SupportsAbs[float]):
|
||||
|
||||
class complex(SupportsAbs[float]):
|
||||
@overload
|
||||
def __init__(self, re: float = 0.0, im: float = 0.0) -> None: ...
|
||||
def __init__(self, re: float = ..., im: float = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, s: str) -> None: ...
|
||||
|
||||
@@ -231,17 +231,17 @@ class unicode(basestring, Sequence[unicode]):
|
||||
@overload
|
||||
def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ...
|
||||
def capitalize(self) -> unicode: ...
|
||||
def center(self, width: int, fillchar: unicode = u' ') -> unicode: ...
|
||||
def center(self, width: int, fillchar: unicode = ...) -> unicode: ...
|
||||
def count(self, x: unicode) -> int: ...
|
||||
def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ...
|
||||
def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ...
|
||||
def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = 0,
|
||||
def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ...,
|
||||
end: int = ...) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> unicode: ...
|
||||
def find(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def expandtabs(self, tabsize: int = ...) -> unicode: ...
|
||||
def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ...
|
||||
def format(self, *args: Any, **kwargs: Any) -> unicode: ...
|
||||
def format_map(self, map: Mapping[unicode, Any]) -> unicode: ...
|
||||
def index(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
def isdecimal(self) -> bool: ...
|
||||
@@ -254,20 +254,20 @@ class unicode(basestring, Sequence[unicode]):
|
||||
def istitle(self) -> bool: ...
|
||||
def isupper(self) -> bool: ...
|
||||
def join(self, iterable: Iterable[unicode]) -> unicode: ...
|
||||
def ljust(self, width: int, fillchar: unicode = u' ') -> unicode: ...
|
||||
def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ...
|
||||
def lower(self) -> unicode: ...
|
||||
def lstrip(self, chars: unicode = ...) -> unicode: ...
|
||||
def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ...
|
||||
def rfind(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def rindex(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def rjust(self, width: int, fillchar: unicode = u' ') -> unicode: ...
|
||||
def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ...
|
||||
def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ...
|
||||
def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ...
|
||||
def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ...
|
||||
def rstrip(self, chars: unicode = ...) -> unicode: ...
|
||||
def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> List[unicode]: ...
|
||||
def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = 0,
|
||||
def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ...,
|
||||
end: int = ...) -> bool: ...
|
||||
def strip(self, chars: unicode = ...) -> unicode: ...
|
||||
def swapcase(self) -> unicode: ...
|
||||
@@ -308,7 +308,7 @@ class str(basestring, Sequence[str]):
|
||||
def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ...
|
||||
def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ...
|
||||
def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]]) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> str: ...
|
||||
def expandtabs(self, tabsize: int = ...) -> str: ...
|
||||
def find(self, sub: unicode, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
|
||||
def format(self, *args: Any, **kwargs: Any) -> str: ...
|
||||
def index(self, sub: unicode, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
|
||||
@@ -405,9 +405,9 @@ class bytearray(MutableSequence[int]):
|
||||
def count(self, x: str) -> int: ...
|
||||
def decode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ...
|
||||
def endswith(self, suffix: Union[str, Tuple[str, ...]]) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> bytearray: ...
|
||||
def find(self, sub: str, start: int = 0, end: int = ...) -> int: ...
|
||||
def index(self, sub: str, start: int = 0, end: int = ...) -> int: ...
|
||||
def expandtabs(self, tabsize: int = ...) -> bytearray: ...
|
||||
def find(self, sub: str, start: int = ..., end: int = ...) -> int: ...
|
||||
def index(self, sub: str, start: int = ..., end: int = ...) -> int: ...
|
||||
def insert(self, index: int, object: int) -> None: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
@@ -422,8 +422,8 @@ class bytearray(MutableSequence[int]):
|
||||
def lstrip(self, chars: str = ...) -> bytearray: ...
|
||||
def partition(self, sep: str) -> Tuple[bytearray, bytearray, bytearray]: ...
|
||||
def replace(self, old: str, new: str, count: int = ...) -> bytearray: ...
|
||||
def rfind(self, sub: str, start: int = 0, end: int = ...) -> int: ...
|
||||
def rindex(self, sub: str, start: int = 0, end: int = ...) -> int: ...
|
||||
def rfind(self, sub: str, start: int = ..., end: int = ...) -> int: ...
|
||||
def rindex(self, sub: str, start: int = ..., end: int = ...) -> int: ...
|
||||
def rjust(self, width: int, fillchar: str = ...) -> bytearray: ...
|
||||
def rpartition(self, sep: str) -> Tuple[bytearray, bytearray, bytearray]: ...
|
||||
def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[bytearray]: ...
|
||||
@@ -479,7 +479,7 @@ class slice(object):
|
||||
@overload
|
||||
def __init__(self, stop: Optional[int]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = None) -> None: ...
|
||||
def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> None: ...
|
||||
def indices(self, len: int) -> Tuple[int, int, int]: ...
|
||||
|
||||
class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
@@ -514,7 +514,7 @@ class list(MutableSequence[_T], Generic[_T]):
|
||||
def append(self, object: _T) -> None: ...
|
||||
def extend(self, iterable: Iterable[_T]) -> None: ...
|
||||
def pop(self, index: int = -1) -> _T: ...
|
||||
def index(self, object: _T, start: int = 0, stop: int = ...) -> int: ...
|
||||
def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ...
|
||||
def count(self, object: _T) -> int: ...
|
||||
def insert(self, index: int, object: _T) -> None: ...
|
||||
def remove(self, object: _T) -> None: ...
|
||||
@@ -654,7 +654,7 @@ class frozenset(AbstractSet[_T], Generic[_T]):
|
||||
def __gt__(self, s: AbstractSet[object]) -> bool: ...
|
||||
|
||||
class enumerate(Iterator[Tuple[int, _T]], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T], start: int = 0) -> None: ...
|
||||
def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ...
|
||||
def __iter__(self) -> Iterator[Tuple[int, _T]]: ...
|
||||
def next(self) -> Tuple[int, _T]: ...
|
||||
# TODO __getattribute__
|
||||
@@ -663,7 +663,7 @@ class xrange(Sized, Iterable[int], Reversible[int]):
|
||||
@overload
|
||||
def __init__(self, stop: int) -> None: ...
|
||||
@overload
|
||||
def __init__(self, start: int, stop: int, step: int = 1) -> None: ...
|
||||
def __init__(self, start: int, stop: int, step: int = ...) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __getitem__(self, i: int) -> int: ...
|
||||
@@ -672,11 +672,11 @@ class xrange(Sized, Iterable[int], Reversible[int]):
|
||||
class property(object):
|
||||
def __init__(self, fget: Optional[Callable[[Any], Any]] = None,
|
||||
fset: Optional[Callable[[Any, Any], None]] = None,
|
||||
fdel: Optional[Callable[[Any], None]] = None, doc: Optional[str] = None) -> None: ...
|
||||
fdel: Optional[Callable[[Any], None]] = None, doc: Optional[str] = ...) -> None: ...
|
||||
def getter(self, fget: Callable[[Any], Any]) -> property: ...
|
||||
def setter(self, fset: Callable[[Any, Any], None]) -> property: ...
|
||||
def deleter(self, fdel: Callable[[Any], None]) -> property: ...
|
||||
def __get__(self, obj: Any, type: Optional[type] = None) -> Any: ...
|
||||
def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ...
|
||||
def __set__(self, obj: Any, value: Any) -> None: ...
|
||||
def __delete__(self, obj: Any) -> None: ...
|
||||
def fget(self) -> Any: ...
|
||||
@@ -694,8 +694,8 @@ def any(i: Iterable[object]) -> bool: ...
|
||||
def bin(number: int) -> str: ...
|
||||
def callable(o: object) -> bool: ...
|
||||
def chr(code: int) -> str: ...
|
||||
def compile(source: Any, filename: unicode, mode: str, flags: int = 0,
|
||||
dont_inherit: int = 0) -> Any: ...
|
||||
def compile(source: Any, filename: unicode, mode: str, flags: int = ...,
|
||||
dont_inherit: int = ...) -> Any: ...
|
||||
def delattr(o: Any, name: unicode) -> None: ...
|
||||
def dir(o: object = ...) -> List[str]: ...
|
||||
@overload
|
||||
@@ -709,8 +709,8 @@ def filter(function: Callable[[_T], Any],
|
||||
@overload
|
||||
def filter(function: None,
|
||||
iterable: Iterable[Optional[_T]]) -> List[_T]: ...
|
||||
def format(o: object, format_spec: str = '') -> str: ... # TODO unicode
|
||||
def getattr(o: Any, name: unicode, default: Optional[Any] = None) -> Any: ...
|
||||
def format(o: object, format_spec: str = ...) -> str: ... # TODO unicode
|
||||
def getattr(o: Any, name: unicode, default: Optional[Any] = ...) -> Any: ...
|
||||
def hasattr(o: Any, name: unicode) -> bool: ...
|
||||
def hash(o: object) -> int: ...
|
||||
def hex(i: int) -> str: ... # TODO __index__
|
||||
@@ -950,15 +950,15 @@ def execfile(filename: str, globals: Optional[Dict[str, Any]] = None, locals: Op
|
||||
|
||||
class file(BinaryIO):
|
||||
@overload
|
||||
def __init__(self, file: str, mode: str = 'r', buffering: int = ...) -> None: ...
|
||||
def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, file: unicode, mode: str = 'r', buffering: int = ...) -> None: ...
|
||||
def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, file: int, mode: str = 'r', buffering: int = ...) -> None: ...
|
||||
def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def __enter__(self) -> BinaryIO: ...
|
||||
def __exit__(self, t: Optional[type] = None, exc: Optional[BaseException] = None, tb: Optional[Any] = None) -> bool: ...
|
||||
def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def fileno(self) -> int: ...
|
||||
def isatty(self) -> bool: ...
|
||||
|
||||
@@ -51,7 +51,7 @@ class Underflow(Inexact, Rounded, Subnormal): ...
|
||||
|
||||
def setcontext(context: Context): ...
|
||||
def getcontext() -> Context: ...
|
||||
def localcontext(ctx: Optional[Context] = None) -> _ContextManager: ...
|
||||
def localcontext(ctx: Optional[Context] = ...) -> _ContextManager: ...
|
||||
|
||||
class Decimal(SupportsAbs[Decimal], SupportsFloat, SupportsInt):
|
||||
def __init__(cls, value: Union[_Decimal, float, str, unicode,
|
||||
@@ -72,7 +72,7 @@ class Decimal(SupportsAbs[Decimal], SupportsFloat, SupportsInt):
|
||||
def to_eng_string(self, context: Context = ...) -> str: ...
|
||||
def __neg__(self) -> Decimal: ...
|
||||
def __pos__(self) -> Decimal: ...
|
||||
def __abs__(self, round: bool = True) -> Decimal: ...
|
||||
def __abs__(self, round: bool = ...) -> Decimal: ...
|
||||
def __add__(self, other: _Decimal) -> Decimal: ...
|
||||
def __radd__(self, other: int) -> Decimal: ...
|
||||
def __sub__(self, other: _Decimal) -> Decimal: ...
|
||||
|
||||
@@ -3,7 +3,7 @@ import collections
|
||||
|
||||
|
||||
class Shelf(collections.MutableMapping):
|
||||
def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = None, writeback: bool = ..., keyencoding: str = 'utf-8') -> None: ...
|
||||
def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def keys(self) -> List[Any]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@@ -20,7 +20,7 @@ class Shelf(collections.MutableMapping):
|
||||
def sync(self) -> None: ...
|
||||
|
||||
class BsdDbShelf(Shelf):
|
||||
def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = None, writeback: bool = ..., keyencoding: str = 'utf-8') -> None: ...
|
||||
def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ...
|
||||
def set_location(self, key: Any) -> Tuple[str, Any]: ...
|
||||
def next(self) -> Tuple[str, Any]: ...
|
||||
def previous(self) -> Tuple[str, Any]: ...
|
||||
@@ -28,6 +28,6 @@ class BsdDbShelf(Shelf):
|
||||
def last(self) -> Tuple[str, Any]: ...
|
||||
|
||||
class DbfilenameShelf(Shelf):
|
||||
def __init__(self, filename: str, flag: str = 'c', protocol: Optional[int] = None, writeback: bool = ...) -> None: ...
|
||||
def __init__(self, filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> None: ...
|
||||
|
||||
def open(filename: str, flag: str = 'c', protocol: Optional[int] = None, writeback: bool = ...) -> DbfilenameShelf: ...
|
||||
def open(filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> DbfilenameShelf: ...
|
||||
|
||||
@@ -113,7 +113,7 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
|
||||
def send(self, value: _T_contra) -> _T_co: ...
|
||||
|
||||
@abstractmethod
|
||||
def throw(self, typ: Type[BaseException], val: Optional[BaseException] = None,
|
||||
def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ...,
|
||||
# TODO: tb should be TracebackType but that's defined in types
|
||||
tb: Any = None) -> _T_co: ...
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class Request(object):
|
||||
def add_header(self, key: str, val: str) -> None: ...
|
||||
def add_unredirected_header(self, key: str, val: str) -> None: ...
|
||||
def has_header(self, header_name: str) -> bool: ...
|
||||
def get_header(self, header_name: str, default: Optional[str] = None) -> str: ...
|
||||
def get_header(self, header_name: str, default: Optional[str] = ...) -> str: ...
|
||||
def header_items(self): ...
|
||||
|
||||
class OpenerDirector(object):
|
||||
|
||||
Reference in New Issue
Block a user