A RetroSearch Logo

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

Search Query:

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

best approach to enabling "metamodules"?

[Python-Dev] advice needed: best approach to enabling "metamodules"? [Python-Dev] advice needed: best approach to enabling "metamodules"?Mark Shannon mark at hotpy.org
Sat Nov 29 21:15:45 CET 2014
On 29/11/14 19:37, Nathaniel Smith wrote:

[snip]

> - The "new module" object has to be a subtype of ModuleType, b/c there
> are lots of places that do isinstance(x, ModuleType) checks (notably

It has to be a *subtype* is does not need to be a *subclass*

>>> class M:
...    __class__ = ModuleType
...
>>> isinstance(M(), ModuleType)
True

Cheers,
Mark.
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