From 5a66e2f21f39237437c53945ffd2860021d929b0 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Tue, 22 Sep 2015 12:54:57 -0700 Subject: [PATCH] Fix errors in _socket.pyi. --- builtins/2.7/_socket.pyi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builtins/2.7/_socket.pyi b/builtins/2.7/_socket.pyi index 51b6a4cf1..cb87cce1f 100644 --- a/builtins/2.7/_socket.pyi +++ b/builtins/2.7/_socket.pyi @@ -1,3 +1,5 @@ +from typing import Tuple, Union, IO, Any, overload + AF_APPLETALK = ... # type: int AF_ASH = ... # type: int AF_ATMPVC = ... # type: int @@ -236,12 +238,11 @@ TIPC_WAIT_FOREVER = ... # type: int TIPC_WITHDRAWN = ... # type: int TIPC_ZONE_SCOPE = ... # type: int -has_ipv6: bool +has_ipv6 = ... # type: bool class error(IOError): ... -class SocketType(object): ... - +class SocketType(object): family = ... # type: int type = ... # type: int proto = ... # type: int @@ -255,7 +256,7 @@ class SocketType(object): ... raise gaierror raise timeout def connect_ex(self, address: tuple) -> int: ... - def dup(self) -> SocketType + def dup(self) -> "SocketType": ... def fileno(self) -> int: ... def getpeername(self) -> tuple: ... def getsockname(self) -> tuple: ... @@ -263,7 +264,7 @@ class SocketType(object): ... def gettimeout(self) -> float: ... def listen(self, backlog: int) -> None: raise error - def makefile(self, mode: str = ..., buffersize: int = ...) -> file: ... + def makefile(self, mode: str = ..., buffersize: int = ...) -> IO[Any]: ... def recv(self, buffersize: int, flags: int = ...) -> str: ... def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ... def recvfrom(self, buffersize: int, flags: int = ...) -> tuple: