mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 22:56:55 +08:00
Add methods for subnet_of and supernet_of (#3851)
This commit is contained in:
5
third_party/2/ipaddress.pyi
vendored
5
third_party/2/ipaddress.pyi
vendored
@@ -1,6 +1,8 @@
|
||||
from typing import (Any, Container, Generic, Iterable, Iterator, Optional,
|
||||
overload, SupportsInt, Text, Tuple, TypeVar)
|
||||
|
||||
import sys
|
||||
|
||||
# Undocumented length constants
|
||||
IPV4LENGTH: int
|
||||
IPV6LENGTH: int
|
||||
@@ -87,6 +89,9 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]):
|
||||
def overlaps(self: _T, other: _T) -> bool: ...
|
||||
@property
|
||||
def prefixlen(self) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def subnet_of(self: _T, other: _T) -> bool: ...
|
||||
def supernet_of(self: _T, other: _T) -> bool: ...
|
||||
def subnets(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Iterator[_T]: ...
|
||||
def supernet(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> _T: ...
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user