[Python-Dev] PEP 318 - posting draft (original) (raw)
Guido van Rossum guido at python.org
Wed Mar 24 11:07:25 EST 2004
- Previous message: [Python-Dev] PEP 318 - posting draft
- Next message: [Python-Dev] PEP 318 - posting draft
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I think this use case is rather elegant:
def singleton(cls): return cls() class Foo [singleton]: ...
And how would this be better than
class Foo(singleton):
...
(with a suitable definition of singleton, which could just be 'object' AFAICT from your example)?
--Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] PEP 318 - posting draft
- Next message: [Python-Dev] PEP 318 - posting draft
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]