Skip to content

Commit

Permalink
Return Any, not Union from IP parsing functions (#2499)
Browse files Browse the repository at this point in the history
Closes: #2080
  • Loading branch information
srittau authored and JelleZijlstra committed Oct 1, 2018
1 parent 3814d47 commit 7be20fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stdlib/3/ipaddress.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from typing import (Any, Container, Generic, Iterable, Iterator, Optional,
overload, SupportsInt, Tuple, TypeVar, Union)
overload, SupportsInt, Tuple, TypeVar)

# Undocumented length constants
IPV4LENGTH: int
Expand All @@ -10,9 +10,9 @@ _A = TypeVar("_A", IPv4Address, IPv6Address)
_N = TypeVar("_N", IPv4Network, IPv6Network)
_T = TypeVar("_T")

def ip_address(address: object) -> Union[IPv4Address, IPv6Address]: ...
def ip_network(address: object, strict: bool = ...) -> Union[IPv4Network, IPv6Network]: ...
def ip_interface(address: object) -> Union[IPv4Interface, IPv6Interface]: ...
def ip_address(address: object) -> Any: ... # morally Union[IPv4Address, IPv6Address]
def ip_network(address: object, strict: bool = ...) -> Any: ... # morally Union[IPv4Network, IPv6Network]
def ip_interface(address: object) -> Any: ... # morally Union[IPv4Interface, IPv6Interface]

class _IPAddressBase:
def __eq__(self, other: Any) -> bool: ...
Expand Down

0 comments on commit 7be20fc

Please sign in to comment.