mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 13:32:26 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import Any, Container, Generic, Iterable, Iterator, SupportsInt, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
# Undocumented length constants
|
||||
IPV4LENGTH: Literal[32]
|
||||
@@ -10,8 +10,8 @@ IPV6LENGTH: Literal[128]
|
||||
_A = TypeVar("_A", IPv4Address, IPv6Address)
|
||||
_N = TypeVar("_N", IPv4Network, IPv6Network)
|
||||
|
||||
_RawIPAddress = int | str | bytes | IPv4Address | IPv6Address
|
||||
_RawNetworkPart = IPv4Network | IPv6Network | IPv4Interface | IPv6Interface
|
||||
_RawIPAddress: TypeAlias = int | str | bytes | IPv4Address | IPv6Address
|
||||
_RawNetworkPart: TypeAlias = IPv4Network | IPv6Network | IPv4Interface | IPv6Interface
|
||||
|
||||
def ip_address(address: _RawIPAddress) -> IPv4Address | IPv6Address: ...
|
||||
def ip_network(address: _RawIPAddress | _RawNetworkPart, strict: bool = ...) -> IPv4Network | IPv6Network: ...
|
||||
|
||||
Reference in New Issue
Block a user