Fix missing argument types in py3 stdlib (#995)

Still missing a few in _subprocess (a Windows-only private module) and decimal
(I gave up).
This commit is contained in:
Jelle Zijlstra
2017-03-14 11:43:42 -07:00
committed by Guido van Rossum
parent 01b3915b3f
commit 11350ed8cc
6 changed files with 16 additions and 14 deletions

View File

@@ -2,12 +2,13 @@
# NOTE: These are incomplete!
from typing import Tuple, Sequence
from typing import Tuple, Sequence, Callable
def cloexec_pipe() -> Tuple[int, int]: ...
def fork_exec(args: Sequence[str],
executable_list, close_fds, fds_to_keep, cwd: str, env_list,
executable_list: Sequence[bytes], close_fds: bool, fds_to_keep: Sequence[int],
cwd: str, env_list: Sequence[bytes],
p2cread: int, p2cwrite: int, c2pred: int, c2pwrite: int,
errread: int, errwrite: int, errpipe_read: int,
errpipe_write: int, restore_signals, start_new_session,
preexec_fn) -> int: ...
errpipe_write: int, restore_signals: int, start_new_session: int,
preexec_fn: Callable[[], None]) -> int: ...

View File

@@ -7,6 +7,7 @@ from typing import (
)
import email.message
import io
from socket import socket
import sys
import ssl
import types
@@ -87,7 +88,7 @@ if sys.version_info >= (3, 5):
closed = ... # type: bool
status = ... # type: int
reason = ... # type: str
def __init__(self, sock, debuglevel: int = ...,
def __init__(self, sock: socket, debuglevel: int = ...,
method: Optional[str] = ..., url: Optional[str] = ...) -> None: ...
def read(self, amt: Optional[int] = ...) -> bytes: ...
def readinto(self, b: bytearray) -> int: ...

View File

@@ -2,7 +2,7 @@
# Based on http://docs.python.org/3.2/library/shlex.html
from typing import List, Tuple, Any, TextIO
from typing import List, Tuple, Any, TextIO, Union, Optional
def split(s: str, comments: bool = ...,
posix: bool = ...) -> List[str]: ...
@@ -26,7 +26,7 @@ class shlex:
token = ... # type: str
eof = ... # type: str
def __init__(self, instream=..., infile=...,
def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ...,
posix: bool = ...) -> None: ...
def get_token(self) -> str: ...
def push_token(self, tok: str) -> None: ...