1

I have written a custom mapping class that inherits from collections.Mapping. Is there an easy way to test if an instance's data is equal to another mapping object, e.g. dict?

Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
Gary van der Merwe
  • 9,134
  • 3
  • 49
  • 80

1 Answers1

1

Sure. Write __eq__ and __ne__ methods that perform this comparison.

kindall
  • 178,883
  • 35
  • 278
  • 309