Use explicit "# type: str" instead of '' shortcut.

This commit is contained in:
Matthias Kramm
2015-11-09 07:59:14 -08:00
parent 63e441e804
commit d2a3d4a4ed
28 changed files with 139 additions and 137 deletions

View File

@@ -13,7 +13,7 @@ def gnu_getopt(args: List[str], shortopts: str,
List[str]]: ...
class GetoptError(Exception):
msg = ''
opt = ''
msg = ... # type: str
opt = ... # type: str
error = GetoptError

View File

@@ -46,15 +46,15 @@ O_DIRECTORY = 0 # Gnu extension if in C library
O_NOFOLLOW = 0 # Gnu extension if in C library
O_NOATIME = 0 # Gnu extension if in C library
curdir = ''
pardir = ''
sep = ''
altsep = ''
extsep = ''
pathsep = ''
defpath = ''
linesep = ''
devnull = ''
curdir = ... # type: str
pardir = ... # type: str
sep = ... # type: str
altsep = ... # type: str
extsep = ... # type: str
pathsep = ... # type: str
defpath = ... # type: str
linesep = ... # type: str
devnull = ... # type: str
F_OK = 0
R_OK = 0

View File

@@ -8,14 +8,14 @@ from typing import overload, List, Any, AnyStr, Tuple, BinaryIO, TextIO
# ----- os.path variables -----
supports_unicode_filenames = False
# aliases (also in os)
curdir = ''
pardir = ''
sep = ''
altsep = ''
extsep = ''
pathsep = ''
defpath = ''
devnull = ''
curdir = ... # type: str
pardir = ... # type: str
sep = ... # type: str
altsep = ... # type: str
extsep = ... # type: str
pathsep = ... # type: str
defpath = ... # type: str
devnull = ... # type: str
# ----- os.path function stubs -----
def abspath(path: AnyStr) -> AnyStr: ...

View File

@@ -11,20 +11,20 @@ def split(s: str, comments: bool = False,
def quote(s: str) -> str: ...
class shlex:
commenters = ''
wordchars = ''
whitespace = ''
escape = ''
quotes = ''
escapedquotes = ''
whitespace_split = ''
infile = ''
commenters = ... # type: str
wordchars = ... # type: str
whitespace = ... # type: str
escape = ... # type: str
quotes = ... # type: str
escapedquotes = ... # type: str
whitespace_split = ... # type: str
infile = ... # type: str
instream = ... # type: TextIO
source = ''
source = ... # type: str
debug = 0
lineno = 0
token = ''
eof = ''
token = ... # type: str
eof = ... # type: str
def __init__(self, instream=None, infile=None,
posix: bool = False) -> None: ...

View File

@@ -4,20 +4,20 @@
from typing import Mapping
ascii_letters = ''
ascii_lowercase = ''
ascii_uppercase = ''
digits = ''
hexdigits = ''
octdigits = ''
punctuation = ''
printable = ''
whitespace = ''
ascii_letters = ... # type: str
ascii_lowercase = ... # type: str
ascii_uppercase = ... # type: str
digits = ... # type: str
hexdigits = ... # type: str
octdigits = ... # type: str
punctuation = ... # type: str
printable = ... # type: str
whitespace = ... # type: str
def capwords(s: str, sep: str = None) -> str: ...
class Template:
template = ''
template = ... # type: str
def __init__(self, template: str) -> None: ...
def substitute(self, mapping: Mapping[str, str], **kwds: str) -> str: ...

View File

@@ -26,7 +26,7 @@ STDOUT = ... # type: Any
class CalledProcessError(Exception):
returncode = 0
cmd = ''
cmd = ... # type: str
output = b'' # May be None
def __init__(self, returncode: int, cmd: str, output: str) -> None: ...

View File

@@ -5,7 +5,7 @@ from typing import Any, List, overload, Callable
class TarError(Exception): ...
class TarInfo:
name = ''
name = ... # type: str
size = 0
uid = 0
gid = 0

View File

@@ -6,8 +6,8 @@
from typing import Tuple, BinaryIO
# global variables
tempdir = ''
template = ''
tempdir = ... # type: str
template = ... # type: str
# TODO text files
@@ -29,7 +29,7 @@ def SpooledTemporaryFile(
...
class TemporaryDirectory:
name = ''
name = ... # type: str
def __init__(self, suffix: str = '', prefix: str = 'tmp',
dir: str = None) -> None: ...
def cleanup(self) -> None: ...

View File

@@ -5,7 +5,7 @@
from typing import Any, Dict, Optional, Callable, TypeVar, Union
class Thread:
name = ''
name = ... # type: str
ident = 0
daemon = False

View File

@@ -45,7 +45,7 @@ class TestResult:
class _AssertRaisesBaseContext:
expected = ... # type: Any
failureException = ... # type: type
obj_name = ''
obj_name = ... # type: str
expected_regex = ... # type: Pattern[str]
class _AssertRaisesContext(_AssertRaisesBaseContext):
@@ -55,7 +55,7 @@ class _AssertRaisesContext(_AssertRaisesBaseContext):
class _AssertWarnsContext(_AssertRaisesBaseContext):
warning = ... # type: Any # TODO precise type
filename = ''
filename = ... # type: str
lineno = 0
def __enter__(self) -> _AssertWarnsContext: ...
def __exit__(self, exc_type, exc_value, tb) -> bool: ...

View File

@@ -8,7 +8,7 @@ ZIP_DEFLATED = 0
def is_zipfile(filename: Union[str, BinaryIO]) -> bool: ...
class ZipInfo:
filename = ''
filename = ... # type: str
date_time = ... # type: Tuple[int, int, int, int, int, int]
compressed_size = 0
file_size = 0