From 7be20fcf91ca4821e9a0e24d6cb0aab290f6bf9b Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 1 Oct 2018 17:48:39 +0200 Subject: [PATCH] Return Any, not Union from IP parsing functions (#2499) Closes: #2080 --- stdlib/3/ipaddress.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/3/ipaddress.pyi b/stdlib/3/ipaddress.pyi index c475a8984ea2..f706330b6426 100644 --- a/stdlib/3/ipaddress.pyi +++ b/stdlib/3/ipaddress.pyi @@ -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 @@ -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: ...