3434
3535class ZeroconfIPv4Address (IPv4Address ):
3636
37- __slots__ = ("_str" , "_is_link_local" )
37+ __slots__ = ("_str" , "_is_link_local" , "_is_unspecified" )
3838
3939 def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
4040 """Initialize a new IPv4 address."""
4141 super ().__init__ (* args , ** kwargs )
4242 self ._str = super ().__str__ ()
4343 self ._is_link_local = super ().is_link_local
44+ self ._is_unspecified = super ().is_unspecified
4445
4546 def __str__ (self ) -> str :
4647 """Return the string representation of the IPv4 address."""
@@ -51,16 +52,22 @@ def is_link_local(self) -> bool:
5152 """Return True if this is a link-local address."""
5253 return self ._is_link_local
5354
55+ @property
56+ def is_unspecified (self ) -> bool :
57+ """Return True if this is an unspecified address."""
58+ return self ._is_unspecified
59+
5460
5561class ZeroconfIPv6Address (IPv6Address ):
5662
57- __slots__ = ("_str" , "_is_link_local" )
63+ __slots__ = ("_str" , "_is_link_local" , "_is_unspecified" )
5864
5965 def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
6066 """Initialize a new IPv6 address."""
6167 super ().__init__ (* args , ** kwargs )
6268 self ._str = super ().__str__ ()
6369 self ._is_link_local = super ().is_link_local
70+ self ._is_unspecified = super ().is_unspecified
6471
6572 def __str__ (self ) -> str :
6673 """Return the string representation of the IPv6 address."""
@@ -71,6 +78,11 @@ def is_link_local(self) -> bool:
7178 """Return True if this is a link-local address."""
7279 return self ._is_link_local
7380
81+ @property
82+ def is_unspecified (self ) -> bool :
83+ """Return True if this is an unspecified address."""
84+ return self ._is_unspecified
85+
7486
7587@lru_cache (maxsize = 512 )
7688def _cached_ip_addresses (address : Union [str , bytes , int ]) -> Optional [Union [IPv4Address , IPv6Address ]]:
0 commit comments