@@ -83,6 +83,7 @@ def _dns_entry_matches(self, other: DNSEntry) -> bool:
8383 return self .key == other .key and self .type == other .type and self .class_ == other .class_
8484
8585 def __eq__ (self , other : Any ) -> bool :
86+ """Equal when key, type and class match."""
8687 return isinstance (other , DNSEntry ) and self ._dns_entry_matches (other )
8788
8889 @staticmethod
@@ -124,6 +125,7 @@ def __hash__(self) -> int:
124125 return self ._hash
125126
126127 def __eq__ (self , other : Any ) -> bool :
128+ """Equal when the entry fields match a question."""
127129 return isinstance (other , DNSQuestion ) and self ._dns_entry_matches (other )
128130
129131 @property
@@ -268,6 +270,7 @@ def write(self, out: DNSOutgoing) -> None:
268270 out .write_string (self .address )
269271
270272 def __eq__ (self , other : Any ) -> bool :
273+ """Equal when address and the entry fields match."""
271274 return isinstance (other , DNSAddress ) and self ._eq (other )
272275
273276 def _eq (self , other : DNSAddress ) -> bool :
@@ -377,6 +380,7 @@ def write(self, out: DNSOutgoing) -> None:
377380 out .write_name (self .alias )
378381
379382 def __eq__ (self , other : Any ) -> bool :
383+ """Equal when alias and the entry fields match."""
380384 return isinstance (other , DNSPointer ) and self ._eq (other )
381385
382386 def _eq (self , other : DNSPointer ) -> bool :
@@ -421,6 +425,7 @@ def __hash__(self) -> int:
421425 return self ._hash
422426
423427 def __eq__ (self , other : Any ) -> bool :
428+ """Equal when text and the entry fields match."""
424429 return isinstance (other , DNSText ) and self ._eq (other )
425430
426431 def _eq (self , other : DNSText ) -> bool :
@@ -502,6 +507,8 @@ def __repr__(self) -> str:
502507
503508
504509class DNSNsec (DNSRecord ):
510+ """NSEC record asserting which record types exist for a name."""
511+
505512 __slots__ = ("_hash" , "next_name" , "rdtypes" )
506513
507514 def __init__ (
@@ -552,6 +559,7 @@ def write(self, out: DNSOutgoing) -> None:
552559 out .write_string (out_bytes )
553560
554561 def __eq__ (self , other : Any ) -> bool :
562+ """Equal when next_name, rdtypes and the entry fields match."""
555563 return isinstance (other , DNSNsec ) and self ._eq (other )
556564
557565 def _eq (self , other : DNSNsec ) -> bool :
0 commit comments