mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
Consistently use '= ...' for optional parameters.
This commit is contained in:
@@ -60,7 +60,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
|
||||
@@ -107,7 +107,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]: ...
|
||||
|
||||
@@ -186,15 +186,15 @@ 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) -> None: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
@abstractmethod
|
||||
def seekable(self) -> bool: ...
|
||||
@abstractmethod
|
||||
@@ -252,7 +252,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
|
||||
@@ -262,11 +262,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
|
||||
@@ -274,26 +274,26 @@ class Pattern(Generic[AnyStr]):
|
||||
groups = 0
|
||||
pattern = None # 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