2022-04-09 04:24 UTC, Terry Reedy <[email protected]>γ―ζΈγγ: > Perhaps something intentionally vague like > > "Manual deletion of entries from sys.modules may invalidate statements > above, even after re-imports." > > or > > "Manual deletion of entries from sys.modules may result in surprising > behavior, even after re-imports."
Not only deletion, but also random assignments: >>> import sys >>> import collections.abc >>> sys.modules['collections'] = 1 >>> import collections.abc >>> collections.abc Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'int' object has no attribute 'abc' _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/IRXLI6XANNQTOGSBQGOFX25UJD6J4SGJ/ Code of Conduct: http://python.org/psf/codeofconduct/
