2424
2525import asyncio
2626import random
27- from typing import TYPE_CHECKING , Dict , List , Optional , cast
27+ from typing import TYPE_CHECKING , cast
2828
2929from .._cache import DNSCache
3030from .._dns import (
@@ -395,7 +395,7 @@ def _set_properties(self, properties: dict[str | bytes, str | bytes | None]) ->
395395 # as-is, without decoding them, otherwise calling
396396 # self.properties will lazy decode them, which is expensive.
397397 if TYPE_CHECKING :
398- self ._properties = cast ("Dict [bytes, Optional[ bytes]]" , properties )
398+ self ._properties = cast (dict [bytes , bytes | None ] , properties )
399399 else :
400400 self ._properties = properties
401401 self .text = result
@@ -462,7 +462,7 @@ def _set_ipv6_addresses_from_cache(self, zc: Zeroconf, now: float_) -> None:
462462 """Set IPv6 addresses from the cache."""
463463 if TYPE_CHECKING :
464464 self ._ipv6_addresses = cast (
465- "List [ZeroconfIPv6Address]" ,
465+ list [ZeroconfIPv6Address ],
466466 self ._get_ip_addresses_from_cache_lifo (zc , now , _TYPE_AAAA ),
467467 )
468468 else :
@@ -472,7 +472,7 @@ def _set_ipv4_addresses_from_cache(self, zc: Zeroconf, now: float_) -> None:
472472 """Set IPv4 addresses from the cache."""
473473 if TYPE_CHECKING :
474474 self ._ipv4_addresses = cast (
475- "List [ZeroconfIPv4Address]" ,
475+ list [ZeroconfIPv4Address ],
476476 self ._get_ip_addresses_from_cache_lifo (zc , now , _TYPE_A ),
477477 )
478478 else :
@@ -724,7 +724,7 @@ def _get_address_records_from_cache_by_type(self, zc: Zeroconf, _type: int_) ->
724724 cache = zc .cache
725725 if TYPE_CHECKING :
726726 records = cast (
727- "List [DNSAddress]" ,
727+ list [DNSAddress ],
728728 cache .get_all_by_details (self .server_key , _type , _CLASS_IN ),
729729 )
730730 else :
0 commit comments