Skip to content

drop union return type from getaddrinfo #1002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion stdlib/2/socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,12 @@ def create_connection(address: Tuple[str, int],
source_address: Tuple[str, int] = ...) -> socket: ...

# the 5th tuple item is an address
# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers
# https://github.com/python/mypy/issues/2509
def getaddrinfo(
host: Optional[str], port: Union[str, int, None], family: int = ...,
socktype: int = ..., proto: int = ...,
flags: int = ...) -> List[Tuple[int, int, int, str, Union[Tuple[str, int], Tuple[str, int, int, int]]]]:
flags: int = ...) -> List[Tuple[int, int, int, str, Tuple[Any, ...]]]:
...

def getfqdn(name: str = ...) -> str: ...
Expand Down
4 changes: 3 additions & 1 deletion stdlib/3.4/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ class AbstractEventLoop(metaclass=ABCMeta):
# Network I/O methods returning Futures.
@abstractmethod
@coroutine
# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers
# https://github.com/python/mypy/issues/2509
def getaddrinfo(self, host: str, port: int, *,
family: int = ..., type: int = ..., proto: int = ..., flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Union[Tuple[str, int], Tuple[str, int, int, int]]]]]: ...
family: int = ..., type: int = ..., proto: int = ..., flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ...
@abstractmethod
@coroutine
def getnameinfo(self, sockaddr: tuple, flags: int = ...) -> Generator[Any, None, Tuple[str, int]]: ...
Expand Down
4 changes: 3 additions & 1 deletion stdlib/3/socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,12 @@ def create_connection(address: Tuple[str, int],
source_address: Tuple[str, int] = ...) -> socket: ...

# the 5th tuple item is an address
# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers
# https://github.com/python/mypy/issues/2509
def getaddrinfo(
host: Optional[str], port: Union[str, int, None], family: int = ...,
socktype: int = ..., proto: int = ...,
flags: int = ...) -> List[Tuple[int, int, int, str, Union[Tuple[str, int], Tuple[str, int, int, int]]]]:
flags: int = ...) -> List[Tuple[int, int, int, str, Tuple[Any, ...]]]:
...

def getfqdn(name: str = ...) -> str: ...
Expand Down