forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request python#4 from cocoatomo/update-master
Have master branch up-to-date
- Loading branch information
Showing
505 changed files
with
17,303 additions
and
8,007 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
-e git+https://github.com/google/pytype.git@master#egg=pytype | ||
pytype>=2018.6.19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
git+https://github.com/python/mypy.git@master | ||
typed-ast>=1.0.4 | ||
flake8==3.3.0 | ||
flake8-bugbear>=17.3.0 | ||
flake8-pyi>=17.1.0 | ||
flake8==3.5.0 | ||
flake8-bugbear==18.2.0 | ||
flake8-pyi>=18.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# NB: SocketServer.pyi and socketserver.pyi must remain consistent! | ||
# Stubs for socketserver | ||
|
||
from typing import Any, BinaryIO, Optional, Tuple, Type | ||
from socket import SocketType | ||
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] | ||
def __init__(self, server_address: Tuple[str, int], | ||
RequestHandlerClass: type) -> None: ... | ||
def fileno(self) -> int: ... | ||
def handle_request(self) -> None: ... | ||
def serve_forever(self, poll_interval: float = ...) -> None: ... | ||
def shutdown(self) -> None: ... | ||
def server_close(self) -> None: ... | ||
def finish_request(self, request: bytes, | ||
client_address: Tuple[str, int]) -> None: ... | ||
def get_request(self) -> None: ... | ||
def handle_error(self, request: bytes, | ||
client_address: Tuple[str, int]) -> None: ... | ||
def handle_timeout(self) -> None: ... | ||
def process_request(self, request: bytes, | ||
client_address: Tuple[str, int]) -> None: ... | ||
def server_activate(self) -> None: ... | ||
def server_bind(self) -> None: ... | ||
def verify_request(self, request: bytes, | ||
client_address: Tuple[str, int]) -> bool: ... | ||
if sys.version_info >= (3, 6): | ||
def __enter__(self) -> BaseServer: ... | ||
def __exit__(self, exc_type: Optional[Type[BaseException]], | ||
exc_val: Optional[BaseException], | ||
exc_tb: Optional[types.TracebackType]) -> bool: ... | ||
if sys.version_info >= (3, 3): | ||
def service_actions(self) -> None: ... | ||
|
||
class TCPServer(BaseServer): | ||
def __init__(self, server_address: Tuple[str, int], | ||
RequestHandlerClass: type, | ||
bind_and_activate: bool = ...) -> None: ... | ||
|
||
class UDPServer(BaseServer): | ||
def __init__(self, server_address: Tuple[str, int], | ||
RequestHandlerClass: type, | ||
bind_and_activate: bool = ...) -> None: ... | ||
|
||
if sys.platform != 'win32': | ||
class UnixStreamServer(BaseServer): | ||
def __init__(self, server_address: Tuple[str, int], | ||
RequestHandlerClass: type, | ||
bind_and_activate: bool = ...) -> None: ... | ||
|
||
class UnixDatagramServer(BaseServer): | ||
def __init__(self, server_address: Tuple[str, int], | ||
RequestHandlerClass: type, | ||
bind_and_activate: bool = ...) -> None: ... | ||
|
||
class ForkingMixIn: ... | ||
class ThreadingMixIn: ... | ||
|
||
class ForkingTCPServer(ForkingMixIn, TCPServer): ... | ||
class ForkingUDPServer(ForkingMixIn, UDPServer): ... | ||
class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... | ||
class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... | ||
if sys.platform != 'win32': | ||
class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... | ||
class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... | ||
|
||
|
||
class BaseRequestHandler: | ||
# Those are technically of types, respectively: | ||
# * Union[SocketType, Tuple[bytes, SocketType]] | ||
# * Union[Tuple[str, int], str] | ||
# 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 | ||
|
||
server = ... # type: BaseServer | ||
def setup(self) -> None: ... | ||
def handle(self) -> None: ... | ||
def finish(self) -> None: ... | ||
|
||
class StreamRequestHandler(BaseRequestHandler): | ||
rfile = ... # type: BinaryIO | ||
wfile = ... # type: BinaryIO | ||
|
||
class DatagramRequestHandler(BaseRequestHandler): | ||
rfile = ... # type: BinaryIO | ||
wfile = ... # type: BinaryIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
import collections | ||
from typing import Iterable, MutableSequence, TypeVar, Union, overload | ||
|
||
class UserList(collections.MutableSequence): ... | ||
_T = TypeVar("_T") | ||
_ULT = TypeVar("_ULT", bound=UserList) | ||
|
||
class UserList(MutableSequence[_T]): | ||
def insert(self, index: int, object: _T) -> None: ... | ||
@overload | ||
def __setitem__(self, i: int, o: _T) -> None: ... | ||
@overload | ||
def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... | ||
def __delitem__(self, i: Union[int, slice]) -> None: ... | ||
def __len__(self) -> int: ... | ||
@overload | ||
def __getitem__(self, i: int) -> _T: ... | ||
@overload | ||
def __getitem__(self: _ULT, s: slice) -> _ULT: ... | ||
def sort(self) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,70 @@ | ||
import collections | ||
from typing import Any, Iterable, List, MutableSequence, Sequence, Optional, overload, Text, TypeVar, Tuple, Union | ||
|
||
class UserString(collections.Sequence): ... | ||
class MutableString(UserString, collections.MutableSequence): ... | ||
_UST = TypeVar("_UST", bound=UserString) | ||
_MST = TypeVar("_MST", bound=MutableString) | ||
|
||
class UserString(Sequence[UserString]): | ||
def __init__(self, seq: object) -> None: ... | ||
def __int__(self) -> int: ... | ||
def __long__(self) -> long: ... | ||
def __float__(self) -> float: ... | ||
def __complex__(self) -> complex: ... | ||
def __hash__(self) -> int: ... | ||
def __len__(self) -> int: ... | ||
@overload | ||
def __getitem__(self: _UST, i: int) -> _UST: ... | ||
@overload | ||
def __getitem__(self: _UST, s: slice) -> _UST: ... | ||
def __add__(self: _UST, other: Any) -> _UST: ... | ||
def __radd__(self: _UST, other: Any) -> _UST: ... | ||
def __mul__(self: _UST, other: int) -> _UST: ... | ||
def __rmul__(self: _UST, other: int) -> _UST: ... | ||
def __mod__(self: _UST, args: Any) -> _UST: ... | ||
def capitalize(self: _UST) -> _UST: ... | ||
def center(self: _UST, width: int, *args: Any) -> _UST: ... | ||
def count(self, sub: int, start: int = ..., end: int = ...) -> int: ... | ||
def decode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... | ||
def encode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... | ||
def endswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... | ||
def expandtabs(self: _UST, tabsize: int = ...) -> _UST: ... | ||
def find(self, sub: Text, start: int = ..., end: int = ...) -> int: ... | ||
def index(self, sub: Text, start: int = ..., end: int = ...) -> int: ... | ||
def isalpha(self) -> bool: ... | ||
def isalnum(self) -> bool: ... | ||
def isdecimal(self) -> bool: ... | ||
def isdigit(self) -> bool: ... | ||
def islower(self) -> bool: ... | ||
def isnumeric(self) -> bool: ... | ||
def isspace(self) -> bool: ... | ||
def istitle(self) -> bool: ... | ||
def isupper(self) -> bool: ... | ||
def join(self, seq: Iterable[Text]) -> Text: ... | ||
def ljust(self: _UST, width: int, *args: Any) -> _UST: ... | ||
def lower(self: _UST) -> _UST: ... | ||
def lstrip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... | ||
def partition(self, sep: Text) -> Tuple[Text, Text, Text]: ... | ||
def replace(self: _UST, old: Text, new: Text, maxsplit: int = ...) -> _UST: ... | ||
def rfind(self, sub: Text, start: int = ..., end: int = ...) -> int: ... | ||
def rindex(self, sub: Text, start: int = ..., end: int = ...) -> int: ... | ||
def rjust(self: _UST, width: int, *args: Any) -> _UST: ... | ||
def rpartition(self, sep: Text) -> Tuple[Text, Text, Text]: ... | ||
def rstrip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... | ||
def split(self, sep: Optional[Text] = ..., maxsplit: int = ...) -> List[Text]: ... | ||
def rsplit(self, sep: Optional[Text] = ..., maxsplit: int = ...) -> List[Text]: ... | ||
def splitlines(self, keepends: int = ...) -> List[Text]: ... | ||
def startswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... | ||
def strip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... | ||
def swapcase(self: _UST) -> _UST: ... | ||
def title(self: _UST) -> _UST: ... | ||
def translate(self: _UST, *args: Any) -> _UST: ... | ||
def upper(self: _UST) -> _UST: ... | ||
def zfill(self: _UST, width: int) -> _UST: ... | ||
|
||
class MutableString(UserString, MutableSequence[MutableString]): | ||
def __setitem__(self, index: Union[int, slice], sub: Any) -> None: ... | ||
def __delitem__(self, index: Union[int, slice]) -> None: ... | ||
def immutable(self) -> UserString: ... | ||
def __iadd__(self: _MST, other: Any) -> _MST: ... | ||
def __imul__(self, n: int) -> _MST: ... | ||
def insert(self, index: int, value: Any) -> None: ... |
Oops, something went wrong.