[Python-Dev] Re: Importing a submodule doesn't always set an attribute on its parent

2022年4月09日 10:25:25 -0700

> 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'
Sure, but I hope people expect that kind of monkey patching to break things.
-CHB
> _______________________________________________
> 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/
>
-- 
Christopher Barker, PhD (Chris)
Python Language Consulting
 - Teaching
 - Scientific Software Development
 - Desktop GUI and Web Development
 - wxPython, numpy, scipy, Cython
_______________________________________________
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/MNW7VHF4DHSAMIULCTN67LOS6BEMOZXK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to