10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f97406b commit bbeb2d2 EF67 Copy full SHA for bbeb2d2
Doc/library/types.rst
@@ -409,7 +409,9 @@ Additional Utility Classes and Functions
409
return "{}({})".format(type(self).__name__, ", ".join(items))
410
411
def __eq__(self, other):
412
- return self.__dict__ == other.__dict__
+ if isinstance(self, SimpleNamespace) and isinstance(other, SimpleNamespace):
413
+ return self.__dict__ == other.__dict__
414
+ return NotImplemented
415
416
``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``.
417
However, for a structured record type use :func:`~collections.namedtuple`
0 commit comments