bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323)
![](https://secure.gravatar.com/avatar/cc7737cd64a84f1b5c61a160798e97ee.jpg?s=120&d=mm&r=g)
https://github.com/python/cpython/commit/558dc8adbec0b85e0ff257fcedc85c5d89c... commit: 558dc8adbec0b85e0ff257fcedc85c5d89cd2825 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: GitHub <noreply@github.com> date: 2018-11-05T17:59:15-08:00 summary: bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323) https://bugs.python.org/issue35119 (cherry picked from commit 0bee3c36d406e47fa9f99cfc1e07b701512c4f3f) Co-authored-by: Denis Osipov <osipov_d@list.ru> files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 2012d7abc23f..be9b3ad1af69 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
participants (1)
-
Miss Islington (bot)