[Python-checkins] bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323)

Ivan Levkivskyi webhook-mailer at python.org
Mon Nov 5 20:53:26 EST 2018


https://github.com/python/cpython/commit/0bee3c36d406e47fa9f99cfc1e07b701512c4f3f
commit: 0bee3c36d406e47fa9f99cfc1e07b701512c4f3f
branch: master
author: Denis Osipov <osipov_d at list.ru>
committer: Ivan Levkivskyi <levkivskyi at gmail.com>
date: 2018-11-06T01:53:21Z
summary:

bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323)

https://bugs.python.org/issue35119

files:
M Doc/reference/datamodel.rst

diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 6067c7252682..24c647d1a8d2 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1580,7 +1580,7 @@ a module object to a subclass of :class:`types.ModuleType`. For example::
 
        def __setattr__(self, attr, value):
            print(f'Setting {attr}...')
-           setattr(self, attr, value)
+           super().__setattr__(attr, value)
 
    sys.modules[__name__].__class__ = VerboseModule
 



More information about the Python-checkins mailing list