From 349ff59f33e82f744209ac9626a3b540eb3f0429 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 16 Mar 2017 07:44:45 -0700 Subject: [PATCH] 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. --- stdlib/2/__builtin__.pyi | 4 +- stdlib/2/encodings/utf_8.pyi | 6 +-- stdlib/2/spwd.pyi | 4 +- stdlib/2/types.pyi | 2 +- stdlib/2and3/asyncore.pyi | 2 +- stdlib/3/builtins.pyi | 4 +- stdlib/3/encodings/utf_8.pyi | 6 +-- stdlib/3/inspect.pyi | 2 +- stdlib/3/linecache.pyi | 6 +-- stdlib/3/queue.pyi | 2 +- stdlib/3/token.pyi | 6 +-- stdlib/3/types.pyi | 2 +- stdlib/3/typing.pyi | 8 ++-- .../requests/packages/urllib3/connection.pyi | 2 +- .../packages/ssl_match_hostname/__init__.pyi | 2 +- third_party/3/lxml/etree.pyi | 48 +++++++++---------- 16 files changed, 53 insertions(+), 53 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index a1a57dee1..04570eef6 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -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] diff --git a/stdlib/2/encodings/utf_8.pyi b/stdlib/2/encodings/utf_8.pyi index 3be496af1..0111184b7 100644 --- a/stdlib/2/encodings/utf_8.pyi +++ b/stdlib/2/encodings/utf_8.pyi @@ -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: ... diff --git a/stdlib/2/spwd.pyi b/stdlib/2/spwd.pyi index ee09838af..ec60e1fbf 100644 --- a/stdlib/2/spwd.pyi +++ b/stdlib/2/spwd.pyi @@ -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: ... diff --git a/stdlib/2/types.pyi b/stdlib/2/types.pyi index 0f195ba6a..8baa490d0 100644 --- a/stdlib/2/types.pyi +++ b/stdlib/2/types.pyi @@ -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: ... diff --git a/stdlib/2and3/asyncore.pyi b/stdlib/2and3/asyncore.pyi index c7bf79397..4816da00f 100644 --- a/stdlib/2and3/asyncore.pyi +++ b/stdlib/2and3/asyncore.pyi @@ -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: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 4ce901e46..178d6bfa6 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -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] diff --git a/stdlib/3/encodings/utf_8.pyi b/stdlib/3/encodings/utf_8.pyi index 3be496af1..0111184b7 100644 --- a/stdlib/3/encodings/utf_8.pyi +++ b/stdlib/3/encodings/utf_8.pyi @@ -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: ... diff --git a/stdlib/3/inspect.pyi b/stdlib/3/inspect.pyi index 5fc5b1929..f3481eba8 100644 --- a/stdlib/3/inspect.pyi +++ b/stdlib/3/inspect.pyi @@ -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, diff --git a/stdlib/3/linecache.pyi b/stdlib/3/linecache.pyi index a77de887c..4f14f6af6 100644 --- a/stdlib/3/linecache.pyi +++ b/stdlib/3/linecache.pyi @@ -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: ... diff --git a/stdlib/3/queue.pyi b/stdlib/3/queue.pyi index f85490d46..9827bc7d3 100644 --- a/stdlib/3/queue.pyi +++ b/stdlib/3/queue.pyi @@ -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): ... diff --git a/stdlib/3/token.pyi b/stdlib/3/token.pyi index 24e6ea364..8b39740fa 100644 --- a/stdlib/3/token.pyi +++ b/stdlib/3/token.pyi @@ -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: ... diff --git a/stdlib/3/types.pyi b/stdlib/3/types.pyi index 4c9535b37..084a1b46e 100644 --- a/stdlib/3/types.pyi +++ b/stdlib/3/types.pyi @@ -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 diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index 560ebf950..c7db3a14d 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -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 diff --git a/third_party/2/requests/packages/urllib3/connection.pyi b/third_party/2/requests/packages/urllib3/connection.pyi index 289fd1836..d98a53754 100644 --- a/third_party/2/requests/packages/urllib3/connection.pyi +++ b/third_party/2/requests/packages/urllib3/connection.pyi @@ -48,4 +48,4 @@ class VerifiedHTTPSConnection(HTTPSConnection): UnverifiedHTTPSConnection = ... # type: Any -class ConnectionError(Exception): pass +class ConnectionError(Exception): ... diff --git a/third_party/2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi b/third_party/2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi index 05c03dc08..41d422040 100644 --- a/third_party/2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi +++ b/third_party/2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi @@ -1 +1 @@ -class CertificateError(ValueError): pass +class CertificateError(ValueError): ... diff --git a/third_party/3/lxml/etree.pyi b/third_party/3/lxml/etree.pyi index 598b95ad4..6421a35b9 100644 --- a/third_party/3/lxml/etree.pyi +++ b/third_party/3/lxml/etree.pyi @@ -23,7 +23,7 @@ class ElementChildIterator(Iterator['_Element']): class _Element(Iterable['_Element']): def addprevious(self, element: '_Element') -> None: - pass + ... attrib = ... # type: MutableMapping[str, str] text = ... # type: AnyStr @@ -32,7 +32,7 @@ class _Element(Iterable['_Element']): def __iter__(self) -> ElementChildIterator: ... class ElementBase(_Element): - pass + ... class _ElementTree: def write(self, @@ -47,29 +47,29 @@ class _ElementTree: exclusive: bool = ..., with_comments: bool = ..., inclusive_ns_prefixes: ListAnyStr = ...) -> None: - pass + ... class _XSLTResultTree(SupportsBytes): - pass + ... class _XSLTQuotedStringParam: - pass + ... class XMLParser: - pass + ... class XMLSchema: def __init__(self, etree: Union[_Element, _ElementTree] = ..., file: Union[AnyStr, typing.IO] = ...) -> None: - pass + ... def assertValid(self, etree: Union[_Element, _ElementTree]) -> None: - pass + ... class XSLTAccessControl: - pass + ... class XSLT: def __init__(self, @@ -77,42 +77,42 @@ class XSLT: extensions: Dict_Tuple2AnyStr_Any = ..., regexp: bool = ..., access_control: XSLTAccessControl = ...) -> None: - pass + ... def __call__(self, _input: Union[_Element, _ElementTree], profile_run: bool = ..., **kwargs: Union[AnyStr, _XSLTQuotedStringParam]) -> _XSLTResultTree: - pass + ... @staticmethod def strparam(s: AnyStr) -> _XSLTQuotedStringParam: - pass + ... def Element(_tag: AnyStr, attrib: DictAnyStr = ..., nsmap: DictAnyStr = ..., **extra: AnyStr) -> _Element: - pass + ... def SubElement(_parent: _Element, _tag: AnyStr, attrib: DictAnyStr = ..., nsmap: DictAnyStr = ..., **extra: AnyStr) -> _Element: - pass + ... def ElementTree(element: _Element = ..., file: Union[AnyStr, typing.IO] = ..., parser: XMLParser = ...) -> _ElementTree: - pass + ... def ProcessingInstruction(target: AnyStr, text: AnyStr = ...) -> _Element: - pass + ... def parse(source: Union[AnyStr, typing.IO], parser: XMLParser = ..., base_url: AnyStr = ...) -> _ElementTree: - pass + ... def fromstring(text: AnyStr, @@ -134,31 +134,31 @@ def tostring(element_or_tree: Union[_Element, _ElementTree], class _ErrorLog: - pass + ... class Error(Exception): - pass + ... class LxmlError(Error): def __init__(self, message: Any, error_log: _ErrorLog = ...) -> None: ... error_log = ... # type: _ErrorLog class DocumentInvalid(LxmlError): - pass + ... class LxmlSyntaxError(LxmlError, SyntaxError): - pass + ... class ParseError(LxmlSyntaxError): - pass + ... class XMLSyntaxError(ParseError): - pass + ... class _Validator: - pass + ... class DTD(_Validator): def __init__(self,