Smalltalk and Python

Rainer Deyke root at rainerdeyke.com
Thu Dec 14 21:06:36 EST 2000


"Greg Ewing" <greg at cosc.canterbury.ac.nz> wrote in message
news:3A397778.2E6D84D3 at cosc.canterbury.ac.nz...
> To mention something vaguely Python-relevant:
> if Python had a convenient syntax for declaring
> singletons, it could be a pretty good language for
> Interactive Fiction...

Meta-classes can turn a class statement into a singleton:

class A(Singleton):
  ...

(where Singleton is an instance of the (meta-)class that implements
singletons, not listed here because I haven't written or found it yet)

It would be nice if the Singleton above was in module __builtin__ or at
least somewhere in the standard library.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list