Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0bee3c3

Browse files
denis-osipovilevkivskyi
authored andcommitted
bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323)
https://bugs.python.org/issue35119
1 parent 6531bf6 commit 0bee3c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/reference/datamodel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ a module object to a subclass of :class:`types.ModuleType`. For example::
15801580

15811581
def __setattr__(self, attr, value):
15821582
print(f'Setting {attr}...')
1583-
setattr(self, attr, value)
1583+
super().__setattr__(attr, value)
15841584

15851585
sys.modules[__name__].__class__ = VerboseModule
15861586

0 commit comments

Comments
 (0)