Commit b5f4941 1 parent ffb7526 commit b5f4941 Copy full SHA for b5f4941
File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ def is_loopback(self) -> bool: # type: ignore[override]
32
32
"""Return True if this is a loopback address."""
33
33
return super ().is_loopback
34
34
35
+ @cached_property
36
+ def is_multicast (self ) -> bool : # type: ignore[override]
37
+ """Return True if this is a multicast address."""
38
+ return super ().is_multicast
39
+
35
40
36
41
class CachedIPv6Address (IPv6Address ):
37
42
def __str__ (self ) -> str :
@@ -58,6 +63,11 @@ def is_loopback(self) -> bool: # type: ignore[override]
58
63
"""Return True if this is a loopback address."""
59
64
return super ().is_loopback
60
65
66
+ @cached_property
67
+ def is_multicast (self ) -> bool : # type: ignore[override]
68
+ """Return True if this is a multicast address."""
69
+ return super ().is_multicast
70
+
61
71
62
72
@lru_cache (maxsize = 512 )
63
73
def _cached_ip_addresses (
Original file line number Diff line number Diff line change @@ -30,12 +30,14 @@ def test_cached_ip_addresses_wrapper():
30
30
assert ipv4 .is_link_local is False
31
31
assert ipv4 .is_unspecified is True
32
32
assert ipv4 .is_loopback is False
33
+ assert ipv4 .is_multicast is False
33
34
34
35
ipv6 = ipaddress .cached_ip_addresses ("fe80::1" )
35
36
assert ipv6 is not None
36
37
assert ipv6 .is_link_local is True
37
38
assert ipv6 .is_unspecified is False
38
39
assert ipv6 .is_loopback is False
40
+ assert ipv6 .is_multicast is False
39
41
40
42
ipv6 = ipaddress .cached_ip_addresses ("0:0:0:0:0:0:0:0" )
41
43
assert ipv6 is not None
You can’t perform that action at this time.
0 commit comments