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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com