Skip to content

Commit

Permalink
Use variable annotations everywhere (#2909)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael0x2a authored and srittau committed Apr 13, 2019
1 parent b3c76aa commit efb6794
Show file tree
Hide file tree
Showing 458 changed files with 9,141 additions and 9,141 deletions.
36 changes: 18 additions & 18 deletions stdlib/2/BaseHTTPServer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ import SocketServer
import mimetools

class HTTPServer(SocketServer.TCPServer):
server_name = ... # type: str
server_port = ... # type: int
server_name: str
server_port: int
def __init__(self, server_address: Tuple[str, int],
RequestHandlerClass: type) -> None: ...

class BaseHTTPRequestHandler:
client_address = ... # type: Tuple[str, int]
server = ... # type: SocketServer.BaseServer
close_connection = ... # type: bool
command = ... # type: str
path = ... # type: str
request_version = ... # type: str
headers = ... # type: mimetools.Message
rfile = ... # type: BinaryIO
wfile = ... # type: BinaryIO
server_version = ... # type: str
sys_version = ... # type: str
error_message_format = ... # type: str
error_content_type = ... # type: str
protocol_version = ... # type: str
MessageClass = ... # type: type
responses = ... # type: Mapping[int, Tuple[str, str]]
client_address: Tuple[str, int]
server: SocketServer.BaseServer
close_connection: bool
command: str
path: str
request_version: str
headers: mimetools.Message
rfile: BinaryIO
wfile: BinaryIO
server_version: str
sys_version: str
error_message_format: str
error_content_type: str
protocol_version: str
MessageClass: type
responses: Mapping[int, Tuple[str, str]]
def __init__(self, request: bytes, client_address: Tuple[str, int],
server: SocketServer.BaseServer) -> None: ...
def handle(self) -> None: ...
Expand Down
50 changes: 25 additions & 25 deletions stdlib/2/ConfigParser.pyi
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
from typing import Any, IO, Sequence, Tuple, Union, List, Dict, Protocol, Optional

DEFAULTSECT = ... # type: str
MAX_INTERPOLATION_DEPTH = ... # type: int
DEFAULTSECT: str
MAX_INTERPOLATION_DEPTH: int

class Error(Exception):
message = ... # type: Any
message: Any
def __init__(self, msg: str = ...) -> None: ...
def _get_message(self) -> None: ...
def _set_message(self, value: str) -> None: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...

class NoSectionError(Error):
section = ... # type: str
section: str
def __init__(self, section: str) -> None: ...

class DuplicateSectionError(Error):
section = ... # type: str
section: str
def __init__(self, section: str) -> None: ...

class NoOptionError(Error):
section = ... # type: str
option = ... # type: str
section: str
option: str
def __init__(self, option: str, section: str) -> None: ...

class InterpolationError(Error):
section = ... # type: str
option = ... # type: str
msg = ... # type: str
section: str
option: str
msg: str
def __init__(self, option: str, section: str, msg: str) -> None: ...

class InterpolationMissingOptionError(InterpolationError):
reference = ... # type: str
reference: str
def __init__(self, option: str, section: str, rawval: str, reference: str) -> None: ...

class InterpolationSyntaxError(InterpolationError): ...
Expand All @@ -40,27 +40,27 @@ class InterpolationDepthError(InterpolationError):
def __init__(self, option: str, section: str, rawval: str) -> None: ...

class ParsingError(Error):
filename = ... # type: str
errors = ... # type: List[Tuple[Any, Any]]
filename: str
errors: List[Tuple[Any, Any]]
def __init__(self, filename: str) -> None: ...
def append(self, lineno: Any, line: Any) -> None: ...

class MissingSectionHeaderError(ParsingError):
lineno = ... # type: Any
line = ... # type: Any
lineno: Any
line: Any
def __init__(self, filename: str, lineno: Any, line: Any) -> None: ...

class _Readable(Protocol):
def readline(self) -> str: ...

class RawConfigParser:
_dict = ... # type: Any
_sections = ... # type: dict
_defaults = ... # type: dict
_optcre = ... # type: Any
SECTCRE = ... # type: Any
OPTCRE = ... # type: Any
OPTCRE_NV = ... # type: Any
_dict: Any
_sections: dict
_defaults: dict
_optcre: Any
SECTCRE: Any
OPTCRE: Any
OPTCRE_NV: Any
def __init__(self, defaults: Dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ...
def defaults(self) -> Dict[Any, Any]: ...
def sections(self) -> List[str]: ...
Expand All @@ -74,7 +74,7 @@ class RawConfigParser:
def _get(self, section: str, conv: type, option: str) -> Any: ...
def getint(self, section: str, option: str) -> int: ...
def getfloat(self, section: str, option: str) -> float: ...
_boolean_states = ... # type: Dict[str, bool]
_boolean_states: Dict[str, bool]
def getboolean(self, section: str, option: str) -> bool: ...
def optionxform(self, optionstr: str) -> str: ...
def has_option(self, section: str, option: str) -> bool: ...
Expand All @@ -85,13 +85,13 @@ class RawConfigParser:
def _read(self, fp: IO[str], fpname: str) -> None: ...

class ConfigParser(RawConfigParser):
_KEYCRE = ... # type: Any
_KEYCRE: Any
def get(self, section: str, option: str, raw: bool = ..., vars: Optional[dict] = ...) -> Any: ...
def items(self, section: str, raw: bool = ..., vars: Optional[dict] = ...) -> List[Tuple[str, Any]]: ...
def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ...
def _interpolation_replace(self, match: Any) -> str: ...

class SafeConfigParser(ConfigParser):
_interpvar_re = ... # type: Any
_interpvar_re: Any
def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ...
def _interpolate_some(self, option: str, accum: list, rest: str, section: str, map: dict, depth: int) -> None: ...
8 changes: 4 additions & 4 deletions stdlib/2/Cookie.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ from typing import Any, Optional
class CookieError(Exception): ...

class Morsel(dict):
key = ... # type: Any
key: Any
def __init__(self): ...
def __setitem__(self, K, V): ...
def isReservedKey(self, K): ...
value = ... # type: Any
coded_value = ... # type: Any
value: Any
coded_value: Any
def set(self, key, val, coded_val, LegalChars=..., idmap=..., translate=...): ...
def output(self, attrs: Optional[Any] = ..., header=...): ...
def js_output(self, attrs: Optional[Any] = ...): ...
Expand Down Expand Up @@ -37,4 +37,4 @@ class SmartCookie(BaseCookie):
def value_decode(self, val): ...
def value_encode(self, val): ...

Cookie = ... # type: Any
Cookie: Any
6 changes: 3 additions & 3 deletions stdlib/2/HTMLParser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ class HTMLParser(ParserBase):
def unescape(self, s: AnyStr) -> AnyStr: ...

class HTMLParseError(Exception):
msg = ... # type: str
lineno = ... # type: int
offset = ... # type: int
msg: str
lineno: int
offset: int
4 changes: 2 additions & 2 deletions stdlib/2/SimpleHTTPServer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import BaseHTTPServer
from StringIO import StringIO

class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
server_version = ... # type: str
server_version: str
def do_GET(self) -> None: ...
def do_HEAD(self) -> None: ...
def send_head(self) -> Optional[IO[str]]: ...
def list_directory(self, path: Union[str, unicode]) -> Optional[StringIO]: ...
def translate_path(self, path: AnyStr) -> AnyStr: ...
def copyfile(self, source: IO[AnyStr], outputfile: IO[AnyStr]): ...
def guess_type(self, path: Union[str, unicode]) -> str: ...
extensions_map = ... # type: Mapping[str, str]
extensions_map: Mapping[str, str]
30 changes: 15 additions & 15 deletions stdlib/2/SocketServer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import sys
import types

class BaseServer:
address_family = ... # type: int
RequestHandlerClass = ... # type: type
server_address = ... # type: Tuple[str, int]
socket = ... # type: SocketType
allow_reuse_address = ... # type: bool
request_queue_size = ... # type: int
socket_type = ... # type: int
timeout = ... # type: Optional[float]
address_family: int
RequestHandlerClass: type
server_address: Tuple[str, int]
socket: SocketType
allow_reuse_address: bool
request_queue_size: int
socket_type: int
timeout: Optional[float]
def __init__(self, server_address: Tuple[str, int],
RequestHandlerClass: type) -> None: ...
def fileno(self) -> int: ...
Expand Down Expand Up @@ -82,18 +82,18 @@ class BaseRequestHandler:
# But there are some concerns that having unions here would cause
# too much inconvenience to people using it (see
# https://github.com/python/typeshed/pull/384#issuecomment-234649696)
request = ... # type: Any
client_address = ... # type: Any
request: Any
client_address: Any

server = ... # type: BaseServer
server: BaseServer
def setup(self) -> None: ...
def handle(self) -> None: ...
def finish(self) -> None: ...

class StreamRequestHandler(BaseRequestHandler):
rfile = ... # type: BinaryIO
wfile = ... # type: BinaryIO
rfile: BinaryIO
wfile: BinaryIO

class DatagramRequestHandler(BaseRequestHandler):
rfile = ... # type: BinaryIO
wfile = ... # type: BinaryIO
rfile: BinaryIO
wfile: BinaryIO
8 changes: 4 additions & 4 deletions stdlib/2/StringIO.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from typing import Any, IO, AnyStr, Iterator, Iterable, Generic, List, Optional

class StringIO(IO[AnyStr], Generic[AnyStr]):
closed = ... # type: bool
softspace = ... # type: int
len = ... # type: int
name = ... # type: str
closed: bool
softspace: int
len: int
name: str
def __init__(self, buf: AnyStr = ...) -> None: ...
def __iter__(self) -> Iterator[AnyStr]: ...
def next(self) -> AnyStr: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/2/UserDict.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _VT = TypeVar('_VT')
_T = TypeVar('_T')

class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]):
data = ... # type: Mapping[_KT, _VT]
data: Mapping[_KT, _VT]

def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ...

Expand Down
Loading

0 comments on commit efb6794

Please sign in to comment.