From: Denis Osipov Date: Tue, 6 Nov 2018 01:53:21 +0000 (+0500) Subject: bpo-35119: Fix RecursionError in example of customizing module attribute access.... X-Git-Tag: v3.8.0a1~571 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bee3c36d406e47fa9f99cfc1e07b701512c4f3f;p=thirdparty%2FPython%2Fcpython.git bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) https://bugs.python.org/issue35119 --- 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