On 29/11/14 01:59, Nathaniel Smith wrote: > Hi all, > [snip] > > Option 3: Make it legal to assign to the __dict__ attribute of a > module object, so that we can write something like > > new_module = MyModuleSubclass(...) > new_module.__dict__ = sys.modules[__name__].__dict__ > sys.modules[__name__].__dict__ = {} # *** > sys.modules[__name__] = new_module > Why does MyModuleClass need to sub-class types.ModuleType? Modules have no special behaviour, apart from the inability to write to their __dict__ attribute, which is the very thing you don't want. If it quacks like a module... Cheers, Mark.
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