How does Mr. Martelli's Borg recipe work ?
Robin Becker
robin at jessikat.fsnet.co.uk
Wed Jul 23 03:45:32 EDT 2003
In article <mailman.1058930376.7219.python-list at python.org>, Ian Bicking
<ianb at colorstudy.com> writes
>
>class _Something:
> ...
>
>TheSomething = _Something()
>
>
>Then just never refer to _Something again. Import TheSomething (calling
>it whatever you want), and use it, not its class. It's a singleton
>because there's only one of them. Simplicity!
>
> Ian
>
....can't one do
class TheSomething:
....
TheSomething = TheSomething()
then it's harder to get at the class which presumably is now only
available as TheSomething.__class__
--
Robin Becker
More information about the Python-list
mailing list