summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/types.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/types.rst b/Doc/library/types.rst
index ad40a9f..6f0dc25 100644
--- a/Doc/library/types.rst
+++ b/Doc/library/types.rst
@@ -409,7 +409,9 @@ Additional Utility Classes and Functions
return "{}({})".format(type(self).__name__, ", ".join(items))
def __eq__(self, other):
- return self.__dict__ == other.__dict__
+ if isinstance(self, SimpleNamespace) and isinstance(other, SimpleNamespace):
+ return self.__dict__ == other.__dict__
+ return NotImplemented
``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``.
However, for a structured record type use :func:`~collections.namedtuple`