Skip to content

Commit

Permalink
Adjust Answer iterator return type as Rdata is unhelpful. Any is
Browse files Browse the repository at this point in the history
better as then duck typing is used, which is inherent to the design
[#1141].
  • Loading branch information
rthalley committed Oct 7, 2024
1 parent 3a0f83f commit 8ce4fcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dns/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
import dns.ipv6
import dns.message
import dns.name
import dns.rdata
import dns.nameserver
import dns.query
import dns.rcode
import dns.rdata
import dns.rdataclass
import dns.rdatatype
import dns.rdtypes.svcbbase
Expand Down Expand Up @@ -298,7 +298,7 @@ def __getattr__(self, attr): # pragma: no cover
def __len__(self) -> int:
return self.rrset and len(self.rrset) or 0

def __iter__(self) -> Iterator[dns.rdata.Rdata]:
def __iter__(self) -> Iterator[Any]:
return self.rrset and iter(self.rrset) or iter(tuple())

def __getitem__(self, i):
Expand Down

0 comments on commit 8ce4fcf

Please sign in to comment.