mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Improve signature of overlaps in ipaddress (#7260)
The `overlaps` method returns False if the version is different:
```
import ipaddress as i
v4=i.IPv4Network('10.0.0.0/8')
v6=i.IPv6Network('2001:db8::2000/124')
print(v6.overlaps(v4)) # False
```
This commit is contained in:
@@ -105,7 +105,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]):
|
||||
def max_prefixlen(self) -> int: ...
|
||||
@property
|
||||
def num_addresses(self) -> int: ...
|
||||
def overlaps(self, other: _BaseNetwork[_A]) -> bool: ...
|
||||
def overlaps(self, other: _BaseNetwork[IPv4Address] | _BaseNetwork[IPv6Address]) -> bool: ...
|
||||
@property
|
||||
def prefixlen(self) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
|
||||
Reference in New Issue
Block a user