A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2014-November/137279.html below:

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

[Python-Dev] advice needed: best approach to enabling "metamodules"? [Python-Dev] advice needed: best approach to enabling "metamodules"?Greg Ewing greg.ewing at canterbury.ac.nz
Sat Nov 29 23:07:57 CET 2014
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4