Standing Objects ... possible?

Andrew Dalke dalke at dalkescientific.com
Sat Feb 2 17:47:05 EST 2002


Philip Swartzleonard:
>What i want is a construct like:
>
>object Foo( ancestor ):
>    pass
...
>    to be more or less equivelent to:
>
>class _Foo( ancestor ):
>    pass
>Foo = _Foo()

There's no reason you need a new name.  Try this:

  class Spam(ancestor):
    pass
  Spam = Spam()

(where I used the more Python appropriate metasyntactic
variable :)

                Andrew
                dalke at dalkescientific.com







More information about the Python-list mailing list