diff options
Diffstat (limited to 'Doc/library/types.rst')
-rw-r--r-- | Doc/library/types.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Doc/library/types.rst b/Doc/library/types.rst index eb27846..118bc4c 100644 --- a/Doc/library/types.rst +++ b/Doc/library/types.rst @@ -252,10 +252,12 @@ Additional Utility Classes and Functions class SimpleNamespace: def __init__(self, **kwargs): self.__dict__.update(kwargs) + def __repr__(self): keys = sorted(self.__dict__) items = ("{}={!r}".format(k, self.__dict__[k]) for k in keys) return "{}({})".format(type(self).__name__, ", ".join(items)) + def __eq__(self, other): return self.__dict__ == other.__dict__ |