feat: speed up responding to queries (#1266) · python-zeroconf/python-zeroconf@24a0a00

@@ -22,7 +22,7 @@

22222323

import enum

2424

import 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

26262727

from ._exceptions import AbstractMethodException

2828

from ._utils.net import _is_v6_address

@@ -533,6 +533,10 @@ def lookup(self) -> Dict[DNSRecord, float]:

533533

"""Return the lookup table."""

534534

return self._get_lookup()

535535536+

def lookup_set(self) -> Set[DNSRecord]:

537+

"""Return the lookup table as aset."""

538+

return set(self._get_lookup())

539+536540

def _get_lookup(self) -> Dict[DNSRecord, float]:

537541

"""Return the lookup table, building it if needed."""

538542

if self._lookup is None: