@@ -417,6 +417,10 @@ def __eq__(self, other):
417
417
"""Abstract method"""
418
418
raise AbstractMethodException
419
419
420
+ def __ne__ (self , other ):
421
+ """Non-equality test"""
422
+ return not self .__eq__ (other )
423
+
420
424
def suppressed_by (self , msg ):
421
425
"""Returns true if any answer in a message can suffice for the
422
426
information held in this record."""
@@ -478,7 +482,12 @@ def write(self, out):
478
482
479
483
def __eq__ (self , other ):
480
484
"""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 )
482
491
483
492
def __repr__ (self ):
484
493
"""String representation"""
@@ -510,9 +519,13 @@ def write(self, out):
510
519
511
520
def __eq__ (self , other ):
512
521
"""Tests equality on cpu and os"""
513
- return (isinstance (other , DNSHinfo ) and
522
+ return (isinstance (other , DNSHinfo ) and DNSEntry . __eq__ ( self , other ) and
514
523
self .cpu == other .cpu and self .os == other .os )
515
524
525
+ def __ne__ (self , other ):
526
+ """Non-equality test"""
527
+ return not self .__eq__ (other )
528
+
516
529
def __repr__ (self ):
517
530
"""String representation"""
518
531
return self .cpu + " " + self .os
@@ -532,7 +545,12 @@ def write(self, out):
532
545
533
546
def __eq__ (self , other ):
534
547
"""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 )
536
554
537
555
def __repr__ (self ):
538
556
"""String representation"""
@@ -554,7 +572,12 @@ def write(self, out):
554
572
555
573
def __eq__ (self , other ):
556
574
"""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 )
558
581
559
582
def __repr__ (self ):
560
583
"""String representation"""
@@ -586,11 +609,16 @@ def write(self, out):
586
609
def __eq__ (self , other ):
587
610
"""Tests equality on priority, weight, port and server"""
588
611
return (isinstance (other , DNSService ) and
612
+ DNSEntry .__eq__ (self , other ) and
589
613
self .priority == other .priority and
590
614
self .weight == other .weight and
591
615
self .port == other .port and
592
616
self .server == other .server )
593
617
618
+ def __ne__ (self , other ):
619
+ """Non-equality test"""
620
+ return not self .__eq__ (other )
621
+
594
622
def __repr__ (self ):
595
623
"""String representation"""
596
624
return self .to_string ("%s:%s" % (self .server , self .port ))
0 commit comments