Terry J. Reedy <tjre...@udel.edu> added the comment:
I carefully redid your test, corrected, 3 times, and it works as expected. Win 10, 3.9.0rc2. >>> import a.tem3 as t >>> t.b Traceback (most recent call last): File "<pyshell#23>", line 1, in <module> t.b AttributeError: module 'a.tem3' has no attribute 'b' # Add 'b = 2' to a/tem3.py and save. >>> import sys >>> del sys.modules['a.tem3'] >>> import a.tem3 as t >>> t.b 2 Without seeing exactly what you did and when, I can only guess that you imported a version of xxx without the 'b' binding. I once added it but *forgot to save* before re-importing. Note that dictionary deletion and importing are well tested operations, so that bugs in normal imports are very unlikely. If you really get a failure, there must be some relevant details that you have omitted, like importing from a remote system that is locally cached, with the local cache unchanged by editing the remote original. Or having an OS bug such that saving a file does not update the 'last changed' time. If you disagree with a closing, please request re-opening and give us a chance to reproduce and discuss first rather than doing so yourself. ---------- nosy: +terry.reedy -paul.moore, steve.dower, tim.golden, zach.ware resolution: -> not a bug status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41770> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com