should "self" be changed?
Dr. BigCock
dreamingforward at gmail.com
Tue Jun 2 13:16:45 EDT 2015
On Tuesday, June 2, 2015 at 11:51:10 AM UTC-5, Steven D'Aprano wrote:
> On Fri, 29 May 2015 12:00 pm, Steven D'Aprano wrote:
>
> [...]
> > in a language where classes are
> > themselves values, there is no reason why a class must be instantiated,
> > particularly if you're only using a single instance of the class. Anyone
> > ever come across a named design pattern that involves using classes
> > directly without instantiating them?
> >
> > I'm basically looking for a less inelegant term for "instanceless class"
> > -- not so much a singleton as a zeroton.
The only reason to have such uninstanced classed is for meta-class programming -- where you're designing classes *programmatically*, not by your interaction and typing in your source code as you normally would.
Otherwise, I'm suspicious that "there's no reason why a class must be instantiated". It's like declaring a complex variable and never using it.
--m
More information about the Python-list
mailing list