mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Consistently use '= ...' for optional parameters.
This commit is contained in:
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user