What do you call a class not intended to be instantiated
steve at REMOVE-THIS-cybersource.com.au
Sun Sep 28 04:47:11 CEST 2008
On Sat, 27 Sep 2008 17:41:42 -0400, Terry Reedy wrote:
> In 3.0, at least, one does not need a disk file to create a module.
> >>> import types
> >>> me = types.ModuleType('me') # type(__builtins__) works, no import
> >>> me
> <module 'me' (built-in)>
> >>> me.a = 1
> >>> me.a
> >>> me.a + 1
Seems to work for Python 2.5 as well.
> That said, a blank class is even easier, and the representation is
And modules aren't callable. I've often thought they should be.
More information about the Python-list