How to make a variable's late binding crosses the module boundary?

Jach Feng jfong at ms4.hinet.net
Thu Sep 1 20:44:46 EDT 2022


ery... at gmail.com 在 2022年9月2日 星期五凌晨12:41:46 [UTC+8] 的信中寫道:
> On 8/31/22, Jach Feng <jf... at ms4.hinet.net> wrote: 
> > 
> > I found that using "from test import *" in test2.py makes test2's relation 
> > to "test" almost like the function's relation to the module where it is 
> > defined. You can refer to all the variables of the module
> Note that in general, if __all__ doesn't exist to explicitly define 
> the contents of a star import, then it imports everything except names 
> that begin with an underscore.
Thank you for pointing out these important difference:-)

--Jach


More information about the Python-list mailing list