Skip to content

Commit

Permalink
Return Any, not Union from IP parsing functions (python#2499)
Browse files Browse the repository at this point in the history
Closes: python#2080
  • Loading branch information
srittau authored and Jiri Suchan committed Jan 23, 2019
1 parent 4720563 commit df011b8
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 df011b8

Please sign in to comment.