Re: [Python-Dev] advice needed: best approach to enabling "metamodules"?

2014年11月29日 14:09:45 -0800

Nathaniel Smith wrote:
So pkgname/__new__.py might look like:
 import sys
 from pkgname._metamodule import MyModuleSubtype
 sys.modules[__name__] = MyModuleSubtype(__name__, docstring)
To start with, the 'from
pkgname._metamodule ...' line is an infinite loop,
Why does MyModuleSubtype have to be imported from pkgname?
It would make more sense for it to be defined directly in
__new__.py, wouldn't it? Isn't the purpose of separating
stuff out into __new__.py precisely to avoid circularities
like that?
--
Greg
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to