egbert wrote:
Yes, you are right. And I can reach everything with
modules['some_package']
or variants thereof.
Although note that the usual way to get it would be
to simply do
import some_package
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Mar 25, 2010 at 12:43:13PM -0400, Terry Reedy wrote:
> On 3/25/2010 6:16 AM, egbert wrote:
> >When I do 'from some_package import some_module'
> >the __init__.py of some_package will be run.
> >However, there will not be anything like a package-module,
> >and the effects of __init__.py see
On 3/25/2010 6:16 AM, egbert wrote:
When I do 'from some_package import some_module'
the __init__.py of some_package will be run.
However, there will not be anything like a package-module,
and the effects of __init__.py seem all to be lost. Is that true ?
No. If you do
from sys import modules
egbert wrote:
> When I do 'from some_package import some_module'
> the __init__.py of some_package will be run.
> However, there will not be anything like a package-module,
> and the effects of __init__.py seem all to be lost. Is that true ?
> Or can I still do something useful with __init__.py ?
When I do 'from some_package import some_module'
the __init__.py of some_package will be run.
However, there will not be anything like a package-module,
and the effects of __init__.py seem all to be lost. Is that true ?
Or can I still do something useful with __init__.py ?
e
--
Egbert Bouwman