feat: speed up responding to queries (#1266) · python-zeroconf/python-zeroconf@24a0a00
@@ -22,7 +22,7 @@
22222323import enum
2424import socket
25-from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union, cast
25+from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Union, cast
26262727from ._exceptions import AbstractMethodException
2828from ._utils.net import _is_v6_address
@@ -533,6 +533,10 @@ def lookup(self) -> Dict[DNSRecord, float]:
533533"""Return the lookup table."""
534534return self._get_lookup()
535535536+def lookup_set(self) -> Set[DNSRecord]:
537+"""Return the lookup table as aset."""
538+return set(self._get_lookup())
539+536540def _get_lookup(self) -> Dict[DNSRecord, float]:
537541"""Return the lookup table, building it if needed."""
538542if self._lookup is None: