mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
change empty bodies from "pass" to "..."
CONTRIBUTING.md says to prefer ... Not the most impactful change but fixing these will allow us to lint for it in the future and get a consistent style.
This commit is contained in:
committed by
Łukasz Langa
parent
17be26165d
commit
349ff59f33
@@ -24,8 +24,8 @@ _T3 = TypeVar('_T3')
|
||||
_T4 = TypeVar('_T4')
|
||||
_TT = TypeVar('_TT', bound='type')
|
||||
|
||||
class staticmethod: pass # Special, only valid as a decorator.
|
||||
class classmethod: pass # Special, only valid as a decorator.
|
||||
class staticmethod: ... # Special, only valid as a decorator.
|
||||
class classmethod: ... # Special, only valid as a decorator.
|
||||
|
||||
class object:
|
||||
__doc__ = ... # type: Optional[str]
|
||||
|
||||
@@ -9,6 +9,6 @@ class StreamWriter(codecs.StreamWriter):
|
||||
class StreamReader(codecs.StreamReader):
|
||||
pass
|
||||
|
||||
def getregentry() -> codecs.CodecInfo: pass
|
||||
def encode(input: str, errors: str = ...) -> bytes: pass
|
||||
def decode(input: bytes, errors: str = ...) -> str: pass
|
||||
def getregentry() -> codecs.CodecInfo: ...
|
||||
def encode(input: str, errors: str = ...) -> bytes: ...
|
||||
def decode(input: bytes, errors: str = ...) -> str: ...
|
||||
|
||||
@@ -11,5 +11,5 @@ class struct_spwd(object):
|
||||
sp_expire = ... # type: int
|
||||
sp_flag = ... # type: int
|
||||
|
||||
def getspall() -> List[struct_spwd]: pass
|
||||
def getspnam() -> struct_spwd: pass
|
||||
def getspall() -> List[struct_spwd]: ...
|
||||
def getspnam() -> struct_spwd: ...
|
||||
|
||||
@@ -127,7 +127,7 @@ class FrameType:
|
||||
f_restricted = ... # type: bool
|
||||
f_trace = ... # type: Callable[[], None]
|
||||
|
||||
def clear(self) -> None: pass
|
||||
def clear(self) -> None: ...
|
||||
|
||||
SliceType = slice
|
||||
class EllipsisType: ...
|
||||
|
||||
@@ -15,7 +15,7 @@ from errno import (EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL,
|
||||
_maptype = Dict[str, Any]
|
||||
|
||||
|
||||
class ExitNow(Exception): pass
|
||||
class ExitNow(Exception): ...
|
||||
|
||||
def read(obj: Any) -> None: ...
|
||||
def write(obj: Any) -> None: ...
|
||||
|
||||
@@ -26,8 +26,8 @@ _T3 = TypeVar('_T3')
|
||||
_T4 = TypeVar('_T4')
|
||||
_TT = TypeVar('_TT', bound='type')
|
||||
|
||||
class staticmethod: pass # Special, only valid as a decorator.
|
||||
class classmethod: pass # Special, only valid as a decorator.
|
||||
class staticmethod: ... # Special, only valid as a decorator.
|
||||
class classmethod: ... # Special, only valid as a decorator.
|
||||
|
||||
class object:
|
||||
__doc__ = ... # type: Optional[str]
|
||||
|
||||
@@ -9,6 +9,6 @@ class StreamWriter(codecs.StreamWriter):
|
||||
class StreamReader(codecs.StreamReader):
|
||||
pass
|
||||
|
||||
def getregentry() -> codecs.CodecInfo: pass
|
||||
def encode(input: str, errors: str = ...) -> bytes: pass
|
||||
def decode(input: bytes, errors: str = ...) -> str: pass
|
||||
def getregentry() -> codecs.CodecInfo: ...
|
||||
def encode(input: str, errors: str = ...) -> bytes: ...
|
||||
def decode(input: bytes, errors: str = ...) -> str: ...
|
||||
|
||||
@@ -95,7 +95,7 @@ class Signature:
|
||||
follow_wrapped: bool = True) -> 'Signature': ...
|
||||
|
||||
# The name is the same as the enum's name in CPython
|
||||
class _ParameterKind: pass
|
||||
class _ParameterKind: ...
|
||||
|
||||
class Parameter:
|
||||
def __init__(self,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from typing import Any
|
||||
|
||||
def getline(filename: str, lineno: int, module_globals: Any=...) -> str: pass
|
||||
def clearcache() -> None: pass
|
||||
def getlines(filename: str, module_globals: Any=...) -> None: pass
|
||||
def getline(filename: str, lineno: int, module_globals: Any=...) -> str: ...
|
||||
def clearcache() -> None: ...
|
||||
def getlines(filename: str, module_globals: Any=...) -> None: ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class Queue(Generic[_T]):
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
def join(self) -> None: ...
|
||||
def qsize(self) -> int: ...
|
||||
def task_done(self) -> None: pass
|
||||
def task_done(self) -> None: ...
|
||||
|
||||
class PriorityQueue(Queue): ...
|
||||
class LifoQueue(Queue): ...
|
||||
|
||||
@@ -58,6 +58,6 @@ N_TOKENS = 0
|
||||
NT_OFFSET = 0
|
||||
tok_name = ... # type: Dict[int, str]
|
||||
|
||||
def ISTERMINAL(x: int) -> bool: pass
|
||||
def ISNONTERMINAL(x: int) -> bool: pass
|
||||
def ISEOF(x: int) -> bool: pass
|
||||
def ISTERMINAL(x: int) -> bool: ...
|
||||
def ISNONTERMINAL(x: int) -> bool: ...
|
||||
def ISEOF(x: int) -> bool: ...
|
||||
|
||||
@@ -129,7 +129,7 @@ class FrameType:
|
||||
f_locals = ... # type: Dict[str, Any]
|
||||
f_trace = ... # type: Callable[[], None]
|
||||
|
||||
def clear(self) -> None: pass
|
||||
def clear(self) -> None: ...
|
||||
|
||||
class GetSetDescriptorType:
|
||||
__name__ = ... # type: str
|
||||
|
||||
@@ -63,11 +63,11 @@ class SupportsFloat(metaclass=ABCMeta):
|
||||
|
||||
class SupportsComplex(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def __complex__(self) -> complex: pass
|
||||
def __complex__(self) -> complex: ...
|
||||
|
||||
class SupportsBytes(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def __bytes__(self) -> bytes: pass
|
||||
def __bytes__(self) -> bytes: ...
|
||||
|
||||
class SupportsAbs(Generic[_T]):
|
||||
@abstractmethod
|
||||
@@ -180,10 +180,10 @@ class Container(Generic[_T_co]):
|
||||
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
class Collection(Sized, Iterable[_T_co], Container[_T_co], Generic[_T_co]): pass
|
||||
class Collection(Sized, Iterable[_T_co], Container[_T_co], Generic[_T_co]): ...
|
||||
_Collection = Collection
|
||||
else:
|
||||
class _Collection(Sized, Iterable[_T_co], Container[_T_co], Generic[_T_co]): pass
|
||||
class _Collection(Sized, Iterable[_T_co], Container[_T_co], Generic[_T_co]): ...
|
||||
|
||||
class Sequence(_Collection[_T_co], Reversible[_T_co], Generic[_T_co]):
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user