Message377142
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. |
|
Date |
User |
Action |
Args |
2020-09-18 23:09:22 | terry.reedy | set | recipients:
+ terry.reedy, steven.daprano, prasechen |
2020-09-18 23:09:22 | terry.reedy | set | messageid: <1600470562.39.0.424476919572.issue41770@roundup.psfhosted.org> |
2020-09-18 23:09:22 | terry.reedy | link | issue41770 messages |
2020-09-18 23:09:21 | terry.reedy | create | |
|