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/2017-November/150566.html below:

[Python-Dev] module customization

[Python-Dev] module customization [Python-Dev] module customizationGreg Ewing greg.ewing at canterbury.ac.nz
Thu Nov 16 01:11:56 EST 2017
Ethan Furman wrote:
> The second way is fairly similar, but instead of replacing the entire 
> sys.modules entry, its class is updated to be the class just created -- 
> something like sys.modules['mymod'].__class__ = MyNewClass .

If the recent suggestion to replace the global namespace
dict with the module object goes ahead, maybe it would enable
using this idiom to reassign the module class:

    class __class__(__class__):
       # module methods here

Badger-badger-badger-ly,
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