Use "..." for attribute values, instead of None, [], {}

This commit is contained in:
Alvaro Caceres
2016-06-15 14:10:04 -05:00
parent f45c00f129
commit d0ac66f5f8
17 changed files with 49 additions and 49 deletions

View File

@@ -1,16 +1,16 @@
from typing import Any, Tuple
__all__ = None # type: list[str]
DEFAULTSECT = None # type: str
MAX_INTERPOLATION_DEPTH = None # type: int
__all__ = ... # type: list[str]
DEFAULTSECT = ... # type: str
MAX_INTERPOLATION_DEPTH = ... # type: int
class Error(Exception):
message = None # type: Any
message = ... # type: Any
def __init__(self, msg: str = ...) -> None: ...
def _get_message(self) -> None: ...
def _set_message(self, value: str) -> None: ...
def __repr__(self) -> str: ...
__str__ = __repr__
def __str__(self) -> str: ...
class NoSectionError(Error):
section = ... # type: str

View File

@@ -4,10 +4,10 @@ class _Feature:
def getOptionalRelease(self) -> _version_info: ...
def getMandatoryRelease(self) -> _version_info: ...
absolute_import = None # type: _Feature
division = None # type: _Feature
generators = None # type: _Feature
nested_scopes = None # type: _Feature
print_function = None # type: _Feature
unicode_literals = None # type: _Feature
with_statement = None # type: _Feature
absolute_import = ... # type: _Feature
division = ... # type: _Feature
generators = ... # type: _Feature
nested_scopes = ... # type: _Feature
print_function = ... # type: _Feature
unicode_literals = ... # type: _Feature
with_statement = ... # type: _Feature

View File

@@ -17,7 +17,7 @@ _KT = TypeVar('_KT')
_VT = TypeVar('_VT')
# namedtuple is special-cased in the type checker; the initializer is ignored.
namedtuple = object()
namedtuple = ... # type: Any
class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]):
def __init__(self, iterable: Iterable[_T] = ...,

View File

@@ -55,7 +55,7 @@ OP = 0
ERRORTOKEN = 0
N_TOKENS = 0
NT_OFFSET = 0
tok_name = {} # type: Dict[int, str]
tok_name = ... # type: Dict[int, str]
def ISTERMINAL(x) -> bool: ...
def ISNONTERMINAL(x) -> bool: ...

View File

@@ -264,12 +264,12 @@ class Match(Generic[AnyStr]):
pos = 0
endpos = 0
lastindex = 0
lastgroup = None # type: AnyStr
string = None # type: AnyStr
lastgroup = ... # type: AnyStr
string = ... # type: AnyStr
# The regular expression object whose match() or search() method produced
# this match instance.
re = None # type: 'Pattern[AnyStr]'
re = ... # type: 'Pattern[AnyStr]'
def expand(self, template: AnyStr) -> AnyStr: ...
@@ -294,7 +294,7 @@ class Pattern(Generic[AnyStr]):
flags = 0
groupindex = 0
groups = 0
pattern = None # type: AnyStr
pattern = ... # type: AnyStr
def search(self, string: AnyStr, pos: int = ...,
endpos: int = ...) -> Match[AnyStr]: ...

View File

@@ -2,12 +2,12 @@
from typing import Dict, List, NamedTuple, Tuple, Sequence, Union, overload
uses_relative = [] # type: List[str]
uses_netloc = [] # type: List[str]
uses_params = [] # type: List[str]
non_hierarchical = [] # type: List[str]
uses_query = [] # type: List[str]
uses_fragment = [] # type: List[str]
uses_relative = ... # type: List[str]
uses_netloc = ... # type: List[str]
uses_params = ... # type: List[str]
non_hierarchical = ... # type: List[str]
uses_query = ... # type: List[str]
uses_fragment = ... # type: List[str]
scheme_chars = ... # type: str
MAX_CACHE_SIZE = 0

View File

@@ -13,9 +13,9 @@ AF_UNSPEC = 0 # from socket
AI_PASSIVE = 0
class Handle:
__slots__ = [] # type: List[str]
__slots__ = ... # type: List[str]
_cancelled = False
_args = [] # type: List[Any]
_args = ... # type: List[Any]
def __init__(self, callback: Callable[[],Any], args: List[Any],
loop: AbstractEventLoop) -> None: ...
def __repr__(self) -> str: ...

View File

@@ -6,9 +6,9 @@ __all__ = ... # type: str
_T = TypeVar('_T')
class _TracebackLogger:
__slots__ = [] # type: List[str]
__slots__ = ... # type: List[str]
exc = ... # type: BaseException
tb = [] # type: List[str]
tb = ... # type: List[str]
def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ...
def activate(self) -> None: ...
def clear(self) -> None: ...

View File

@@ -16,8 +16,8 @@ def wait_for(fut: Union[Future[_T], Generator[Any, None, _T]], timeout: float, *
class Task(Future[_T], Generic[_T]):
_all_tasks = None # type: Set[Task]
_current_tasks = {} # type: Dict[AbstractEventLoop, Task]
_all_tasks = ... # type: Set[Task]
_current_tasks = ... # type: Dict[AbstractEventLoop, Task]
@classmethod
def current_task(cls, loop: AbstractEventLoop = ...) -> Task: ...
@classmethod

View File

@@ -10,7 +10,7 @@ class Enum:
def __reduce_ex__(self, proto: Any) -> Any: ...
name = ... # type: str
value = None # type: Any
value = ... # type: Any
class IntEnum(int, Enum): ...

View File

@@ -35,7 +35,7 @@ class MutableString(UserString, MutableSequence): ...
# Technically, deque only derives from MutableSequence in 3.5.
# But in practice it's not worth losing sleep over.
class deque(MutableSequence[_T], Generic[_T]):
maxlen = 0 # type: Optional[int] # TODO readonly
maxlen = ... # type: Optional[int] # TODO readonly
def __init__(self, iterable: Iterable[_T] = ...,
maxlen: int = ...) -> None: ...
def append(self, x: _T) -> None: ...

View File

@@ -15,9 +15,9 @@ import os.path as path
supports_bytes_environ = False # TODO: True when bytes implemented?
SEEK_SET = 0 # type: int
SEEK_CUR = 1 # type: int
SEEK_END = 2 # type: int
SEEK_SET = 0
SEEK_CUR = 0
SEEK_END = 0
O_RDONLY = 0
O_WRONLY = 0

View File

@@ -56,7 +56,7 @@ OP = 0
ERRORTOKEN = 0
N_TOKENS = 0
NT_OFFSET = 0
tok_name = {} # type: Dict[int, str]
tok_name = ... # type: Dict[int, str]
def ISTERMINAL(x: int) -> bool: pass
def ISNONTERMINAL(x: int) -> bool: pass

View File

@@ -19,12 +19,12 @@ __all__ = (
'unquote_to_bytes'
)
uses_relative = [] # type: List[str]
uses_netloc = [] # type: List[str]
uses_params = [] # type: List[str]
non_hierarchical = [] # type: List[str]
uses_query = [] # type: List[str]
uses_fragment = [] # type: List[str]
uses_relative = ... # type: List[str]
uses_netloc = ... # type: List[str]
uses_params = ... # type: List[str]
non_hierarchical = ... # type: List[str]
uses_query = ... # type: List[str]
uses_fragment = ... # type: List[str]
scheme_chars = ... # type: str
MAX_CACHE_SIZE = 0

View File

@@ -10,7 +10,7 @@ class Enum:
def __reduce_ex__(self, proto: Any) -> Any: ...
name = ... # type: str
value = None # type: Any
value = ... # type: Any
class IntEnum(int, Enum): ...

View File

@@ -64,19 +64,19 @@ class FlagValues:
# TODO validator: gflags_validators.Validator
def AddValidator(self, validator: Any) -> None: ...
FLAGS = None # type: FlagValues
FLAGS = ... # type: FlagValues
class Flag:
name = ... # type: str
default = None # type: Any
default = ... # type: Any
default_as_str = ... # type: str
value = None # type: Any
value = ... # type: Any
help = ... # type: str
short_name = ... # type: str
boolean = False
present = False
parser = None # type: ArgumentParser
serializer = None # type: ArgumentSerializer
parser = ... # type: ArgumentParser
serializer = ... # type: ArgumentSerializer
allow_override = False
def __init__(self, parser: ArgumentParser, serializer: ArgumentSerializer, name: str,

View File

@@ -77,7 +77,7 @@ class DefaultClause(FetchedValue): ...
class PassiveDefault(DefaultClause): ...
class Constraint(DialectKWArgs, SchemaItem): ...
class ColumnCollectionMixin(object):
columns = None # type: Any
columns = ... # type: Any
def __init__(self, *columns, **kw): ...
@classmethod
def _extract_col_expression_collection(cls, expressions): ...