[Python-ideas] Module/Package-Class Unification

Carl Johnson carl at carlsensei.com
Fri Sep 19 05:51:00 CEST 2008


Is there a good reason why I can't do something like:

import mypackage
import mymodule

x = mypackage(arg, kwarg)
y = mymodule + 3

and other methods, etc. using the __special__ methods.

Also, wouldn't it be cool if modules/packages could have metaclass- 
like handlers…

I'm sure there's a good reason why this is just crazy talk  
implementation-wise, but I'd like to hear what it is. Python has  
merged types and classes, why not merging in packages and modules, too?

-- Carl Johnson



More information about the Python-ideas mailing list