[Python-ideas] Module/Package-Class Unification

Ron Adam rrr at ronadam.com
Fri Sep 19 19:14:31 CEST 2008



Carl Johnson wrote:
> 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?


Would these __special__ methods be seperate files like __init__.py is for 
packages?

Ron




More information about the Python-ideas mailing list