[Tutor] modules == class instances?

alan.gauld@bt.com alan.gauld@bt.com
Thu, 4 Apr 2002 16:34:49 +0100


> > > Yes, modules are also "objects" in Python.  

> > I heard a rumor that a future Python would allow us to 
> subclass entire modules, as we do classes.  Was I dreaming.  

No, its in amongst the metaprogramming stuff.
You can subclass any builtin object in Python 
- int, float, string, list, function(!), and module...

It does get a bit wacky conceptually however but there 
is a paper on unifying the type and class models.

Alan g.