Re: [Tutor] When you think to setup the __class__ of a module object to a subclass of ModuleType

2019-04-24 Thread Alan Gauld via Tutor
On 24/04/2019 12:22, Arup Rakshit wrote: > In the simple code like what are the advantages we get from? I'm not really sure what you are asking about? > Is this so that we can implement more special methods > than just __getattr__ and __dir__ in the module level? Is it just the inheritance fro

[Tutor] When you think to setup the __class__ of a module object to a subclass of ModuleType

2019-04-24 Thread Arup Rakshit
In the simple code like what are the advantages we get from? Is this so that we can implement more special methods than just __getattr__ and __dir__ in the module level? import sys from types import ModuleType class VerboseModule(ModuleType): def __repr__(self): return f'Verbose {s