The Voidspace Techie Blog

Gravatar Though interesting problems, even the best solution isn't a very good one. In the end, you just have to admit that you aren't really doing much except wrapping the module up, and it barely even matters (does it at all?) to be inheriting ModuleType for that wrapper class. Of course, you can't forget that modules are limited on purpose, and as soon as every module is acting like a class, and you can even do __class__ = type at a global level, you just open the doors for abuse and crazy Java-migratories-go-nuts code.


Gravatar Ahh... so you did get it

It's a silly hack.

It illustrates that :

a) You can subclass ModuleType
b) Magic methods are looked up on the class (type) not the instance.


Name:

Email:

URL:

Comment:  ? 


 

Commenting by HaloScan