mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Prefer to use ellipsis over pass (#2292)
This commit is contained in:
committed by
Jelle Zijlstra
parent
187aaaced9
commit
581705d9ee
@@ -12,8 +12,6 @@ def scanstring(a, b, *args, **kwargs) -> tuple:
|
||||
raise TypeError()
|
||||
|
||||
|
||||
class Encoder(object):
|
||||
pass
|
||||
class Encoder(object): ...
|
||||
|
||||
class Scanner(object):
|
||||
pass
|
||||
class Scanner(object): ...
|
||||
|
||||
@@ -33,13 +33,10 @@ SEEK_END = ... # type: int
|
||||
|
||||
class IOBase(_io._IOBase): ...
|
||||
|
||||
class RawIOBase(_io._RawIOBase, IOBase):
|
||||
pass
|
||||
class RawIOBase(_io._RawIOBase, IOBase): ...
|
||||
|
||||
class BufferedIOBase(_io._BufferedIOBase, IOBase):
|
||||
pass
|
||||
class BufferedIOBase(_io._BufferedIOBase, IOBase): ...
|
||||
|
||||
# Note: In the actual io.py, TextIOBase subclasses IOBase.
|
||||
# (Which we don't do here because we don't want to subclass both TextIO and BinaryIO.)
|
||||
class TextIOBase(_io._TextIOBase):
|
||||
pass
|
||||
class TextIOBase(_io._TextIOBase): ...
|
||||
|
||||
@@ -15,11 +15,8 @@ class LockType:
|
||||
def __enter__(self) -> LockType: ...
|
||||
def __exit__(self, typ: Any, value: Any, traceback: Any) -> None: ...
|
||||
|
||||
class _local(object):
|
||||
pass
|
||||
|
||||
class _localdummy(object):
|
||||
pass
|
||||
class _local(object): ...
|
||||
class _localdummy(object): ...
|
||||
|
||||
def start_new(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ...
|
||||
def start_new_thread(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ...
|
||||
|
||||
@@ -122,11 +122,9 @@ def tokenize(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, str,
|
||||
def tokenize_loop(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, str, _Pos, _Pos, str]], None]) -> None: ...
|
||||
def untokenize(iterable: Iterable[_TokenType]) -> str: ...
|
||||
|
||||
class StopTokenizing(Exception):
|
||||
pass
|
||||
class StopTokenizing(Exception): ...
|
||||
|
||||
class TokenError(Exception):
|
||||
pass
|
||||
class TokenError(Exception): ...
|
||||
|
||||
class Untokenizer:
|
||||
prev_col = ... # type: int
|
||||
|
||||
@@ -66,7 +66,7 @@ class _CData(metaclass=_CDataMeta):
|
||||
@classmethod
|
||||
def in_dll(cls: Type[_CT], library: CDLL, name: str) -> _CT: ...
|
||||
|
||||
class _PointerLike(_CData): pass
|
||||
class _PointerLike(_CData): ...
|
||||
|
||||
_ECT = Callable[[Optional[Type[_CData]],
|
||||
_FuncPointer,
|
||||
@@ -240,10 +240,10 @@ class _StructUnionBase(_CData, metaclass=_StructUnionMeta):
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
|
||||
class Union(_StructUnionBase): pass
|
||||
class Structure(_StructUnionBase): pass
|
||||
class BigEndianStructure(Structure): pass
|
||||
class LittleEndianStructure(Structure): pass
|
||||
class Union(_StructUnionBase): ...
|
||||
class Structure(_StructUnionBase): ...
|
||||
class BigEndianStructure(Structure): ...
|
||||
class LittleEndianStructure(Structure): ...
|
||||
|
||||
class Array(Generic[_T], _CData):
|
||||
_length_: ClassVar[int] = ...
|
||||
|
||||
@@ -10,7 +10,7 @@ from typing import (
|
||||
|
||||
_LongResp = Tuple[bytes, List[bytes], int]
|
||||
|
||||
class error_proto(Exception): pass
|
||||
class error_proto(Exception): ...
|
||||
|
||||
POP3_PORT: int
|
||||
POP3_SSL_PORT: int
|
||||
|
||||
@@ -75,8 +75,7 @@ class Thread:
|
||||
def setDaemon(self, daemonic: bool) -> None: ...
|
||||
|
||||
|
||||
class _DummyThread(Thread):
|
||||
pass
|
||||
class _DummyThread(Thread): ...
|
||||
|
||||
|
||||
class Lock:
|
||||
|
||||
@@ -14,6 +14,6 @@ class abstractproperty(property): ...
|
||||
def abstractstaticmethod(callable: _FuncT) -> _FuncT: ...
|
||||
def abstractclassmethod(callable: _FuncT) -> _FuncT: ...
|
||||
|
||||
class ABC(metaclass=ABCMeta):
|
||||
pass
|
||||
class ABC(metaclass=ABCMeta): ...
|
||||
|
||||
def get_cache_token() -> object: ...
|
||||
|
||||
@@ -184,12 +184,10 @@ class ConverterMapping(MutableMapping[str, Optional[_converter]]):
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
|
||||
class Error(Exception):
|
||||
pass
|
||||
class Error(Exception): ...
|
||||
|
||||
|
||||
class NoSectionError(Error):
|
||||
pass
|
||||
class NoSectionError(Error): ...
|
||||
|
||||
|
||||
class DuplicateSectionError(Error):
|
||||
@@ -215,16 +213,14 @@ class InterpolationError(Error):
|
||||
option = ... # type: str
|
||||
|
||||
|
||||
class InterpolationDepthError(InterpolationError):
|
||||
pass
|
||||
class InterpolationDepthError(InterpolationError): ...
|
||||
|
||||
|
||||
class InterpolationMissingOptionError(InterpolationError):
|
||||
reference = ... # type: str
|
||||
|
||||
|
||||
class InterpolationSyntaxError(InterpolationError):
|
||||
pass
|
||||
class InterpolationSyntaxError(InterpolationError): ...
|
||||
|
||||
|
||||
class ParsingError(Error):
|
||||
|
||||
@@ -9,5 +9,4 @@ def getpass(prompt: str = ..., stream: Optional[TextIO] = ...) -> str: ...
|
||||
def getuser() -> str: ...
|
||||
|
||||
|
||||
class GetPassWarning(UserWarning):
|
||||
pass
|
||||
class GetPassWarning(UserWarning): ...
|
||||
|
||||
@@ -177,8 +177,7 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]):
|
||||
# NOTE: This type does not exist in typing.py or PEP 484.
|
||||
# The parameters corrrespond to Generator, but the 4th is the original type.
|
||||
class AwaitableGenerator(Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co],
|
||||
Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta):
|
||||
pass
|
||||
Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta): ...
|
||||
|
||||
@runtime
|
||||
class AsyncIterable(Protocol[_T_co]):
|
||||
|
||||
3
third_party/2/pycurl.pyi
vendored
3
third_party/2/pycurl.pyi
vendored
@@ -17,8 +17,7 @@ version = ... # type: str
|
||||
def version_info() -> Tuple[int, str, int, str, int, str,
|
||||
int, str, tuple, Any, int, Any]: ...
|
||||
|
||||
class error(Exception):
|
||||
pass
|
||||
class error(Exception): ...
|
||||
|
||||
class Curl(object):
|
||||
def close(self) -> None: ...
|
||||
|
||||
@@ -48,11 +48,7 @@ class RepeatedCompositeFieldContainer(BaseContainer[_T]):
|
||||
def __delslice__(self, start: int, stop: int) -> None: ...
|
||||
|
||||
# Classes not yet typed
|
||||
class Mapping(Any):
|
||||
pass
|
||||
class MutableMapping(Mapping):
|
||||
pass
|
||||
class ScalarMap(MutableMapping):
|
||||
pass
|
||||
class MessageMap(MutableMapping):
|
||||
pass
|
||||
class Mapping(Any): ...
|
||||
class MutableMapping(Mapping): ...
|
||||
class ScalarMap(MutableMapping): ...
|
||||
class MessageMap(MutableMapping): ...
|
||||
|
||||
35
third_party/2and3/pynamodb/exceptions.pyi
vendored
35
third_party/2and3/pynamodb/exceptions.pyi
vendored
@@ -5,32 +5,15 @@ class PynamoDBException(Exception):
|
||||
cause: Any
|
||||
def __init__(self, msg: Optional[Text] = ..., cause: Optional[Exception] = ...) -> None: ...
|
||||
|
||||
class PynamoDBConnectionError(PynamoDBException):
|
||||
pass
|
||||
|
||||
class DeleteError(PynamoDBConnectionError):
|
||||
pass
|
||||
|
||||
class QueryError(PynamoDBConnectionError):
|
||||
pass
|
||||
|
||||
class ScanError(PynamoDBConnectionError):
|
||||
pass
|
||||
|
||||
class PutError(PynamoDBConnectionError):
|
||||
pass
|
||||
|
||||
class UpdateError(PynamoDBConnectionError):
|
||||
pass
|
||||
|
||||
class GetError(PynamoDBConnectionError):
|
||||
pass
|
||||
|
||||
class TableError(PynamoDBConnectionError):
|
||||
pass
|
||||
|
||||
class DoesNotExist(PynamoDBException):
|
||||
pass
|
||||
class PynamoDBConnectionError(PynamoDBException): ...
|
||||
class DeleteError(PynamoDBConnectionError): ...
|
||||
class QueryError(PynamoDBConnectionError): ...
|
||||
class ScanError(PynamoDBConnectionError): ...
|
||||
class PutError(PynamoDBConnectionError): ...
|
||||
class UpdateError(PynamoDBConnectionError): ...
|
||||
class GetError(PynamoDBConnectionError): ...
|
||||
class TableError(PynamoDBConnectionError): ...
|
||||
class DoesNotExist(PynamoDBException): ...
|
||||
|
||||
class TableDoesNotExist(PynamoDBException):
|
||||
def __init__(self, table_name) -> None: ...
|
||||
|
||||
18
third_party/3/jwt/__init__.pyi
vendored
18
third_party/3/jwt/__init__.pyi
vendored
@@ -16,15 +16,15 @@ def register_algorithm(alg_id: str,
|
||||
|
||||
def unregister_algorithm(alg_id: str) -> None: ...
|
||||
|
||||
class InvalidTokenError(Exception): pass
|
||||
class DecodeError(InvalidTokenError): pass
|
||||
class ExpiredSignatureError(InvalidTokenError): pass
|
||||
class InvalidAudienceError(InvalidTokenError): pass
|
||||
class InvalidIssuerError(InvalidTokenError): pass
|
||||
class InvalidIssuedAtError(InvalidTokenError): pass
|
||||
class ImmatureSignatureError(InvalidTokenError): pass
|
||||
class InvalidKeyError(Exception): pass
|
||||
class InvalidAlgorithmError(InvalidTokenError): pass
|
||||
class InvalidTokenError(Exception): ...
|
||||
class DecodeError(InvalidTokenError): ...
|
||||
class ExpiredSignatureError(InvalidTokenError): ...
|
||||
class InvalidAudienceError(InvalidTokenError): ...
|
||||
class InvalidIssuerError(InvalidTokenError): ...
|
||||
class InvalidIssuedAtError(InvalidTokenError): ...
|
||||
class ImmatureSignatureError(InvalidTokenError): ...
|
||||
class InvalidKeyError(Exception): ...
|
||||
class InvalidAlgorithmError(InvalidTokenError): ...
|
||||
class MissingRequiredClaimError(InvalidTokenError): ...
|
||||
|
||||
# Compatibility aliases (deprecated)
|
||||
|
||||
Reference in New Issue
Block a user