aleax at aleax.it
Sun Jan 27 15:31:22 EST 2002
Pedro Rodriguez wrote:
> Let me think.
> I only have 2 wishes left...
> Now I would like : the singleton, the enumeration metaclasses.
> Even the Borg pattern will be meta-assimiled ;)
> ... correction, this has already happened, in 'descrintro'
Actually, the (nice!) metaclass examples in descrintro are autoprop and
autosuper -- the Singleton example is just a base class that overrides
__new__ (and implements a "classic" Singleton, not a Borg), and I
can't see anything there about enumerations. It's easy to write
metaclasses for each of these purposes, of course -- the issue with
autoenum is mostly one of defining what features you require and finding a
syntax sugar you like, and similarly for autoborg.
More information about the Python-list