@@ -417,6 +417,10 @@ def __eq__(self, other):
417417 """Abstract method"""
418418 raise AbstractMethodException
419419
420+ def __ne__ (self , other ):
421+ """Non-equality test"""
422+ return not self .__eq__ (other )
423+
420424 def suppressed_by (self , msg ):
421425 """Returns true if any answer in a message can suffice for the
422426 information held in this record."""
@@ -478,7 +482,12 @@ def write(self, out):
478482
479483 def __eq__ (self , other ):
480484 """Tests equality on address"""
481- return isinstance (other , DNSAddress ) and self .address == other .address
485+ return (isinstance (other , DNSAddress ) and DNSEntry .__eq__ (self , other ) and
486+ self .address == other .address )
487+
488+ def __ne__ (self , other ):
489+ """Non-equality test"""
490+ return not self .__eq__ (other )
482491
483492 def __repr__ (self ):
484493 """String representation"""
@@ -510,9 +519,13 @@ def write(self, out):
510519
511520 def __eq__ (self , other ):
512521 """Tests equality on cpu and os"""
513- return (isinstance (other , DNSHinfo ) and
522+ return (isinstance (other , DNSHinfo ) and DNSEntry . __eq__ ( self , other ) and
514523 self .cpu == other .cpu and self .os == other .os )
515524
525+ def __ne__ (self , other ):
526+ """Non-equality test"""
527+ return not self .__eq__ (other )
528+
516529 def __repr__ (self ):
517530 """String representation"""
518531 return self .cpu + " " + self .os
@@ -532,7 +545,12 @@ def write(self, out):
532545
533546 def __eq__ (self , other ):
534547 """Tests equality on alias"""
535- return isinstance (other , DNSPointer ) and self .alias == other .alias
548+ return (isinstance (other , DNSPointer ) and DNSEntry .__eq__ (self , other ) and
549+ self .alias == other .alias )
550+
551+ def __ne__ (self , other ):
552+ """Non-equality test"""
553+ return not self .__eq__ (other )
536554
537555 def __repr__ (self ):
538556 """String representation"""
@@ -554,7 +572,12 @@ def write(self, out):
554572
555573 def __eq__ (self , other ):
556574 """Tests equality on text"""
557- return isinstance (other , DNSText ) and self .text == other .text
575+ return (isinstance (other , DNSText ) and DNSEntry .__eq__ (self , other ) and
576+ self .text == other .text )
577+
578+ def __ne__ (self , other ):
579+ """Non-equality test"""
580+ return not self .__eq__ (other )
558581
559582 def __repr__ (self ):
560583 """String representation"""
@@ -586,11 +609,16 @@ def write(self, out):
586609 def __eq__ (self , other ):
587610 """Tests equality on priority, weight, port and server"""
588611 return (isinstance (other , DNSService ) and
612+ DNSEntry .__eq__ (self , other ) and
589613 self .priority == other .priority and
590614 self .weight == other .weight and
591615 self .port == other .port and
592616 self .server == other .server )
593617
618+ def __ne__ (self , other ):
619+ """Non-equality test"""
620+ return not self .__eq__ (other )
621+
594622 def __repr__ (self ):
595623 """String representation"""
596624 return self .to_string ("%s:%s" % (self .server , self .port ))
0 commit comments