Standing Objects ... possible?
quinn at spew.ugcs.caltech.edu
Fri Feb 8 07:43:59 CET 2002
On 2 Feb 2002 20:25:52 GMT, Philip Swartzleonard <starx at pacbell.net> wrote:
> I have this vague idea that this would be useful in the near
>future, and I was wondering if it was at all possible without recoding
>the interperter. What i want is a construct like:
>object Foo( ancestor ):
> or more likely:
>class Foo( ancestor, standing_mixin ):
> to be more or less equivelent to:
>class _Foo( ancestor ):
>Foo = _Foo()
> The second option looked easy at one point, but I don't think that
>I can make it self-initiate... In any case, is there a prefered way of
>writing hidden stuff like the _Foo for doing it the more possible way?
Well, the obvious is:
foo = foo()
That'll get the name out of the way at least. You could also del it, if it's
really causing you aesthetic pain.
I've no clue what you mean by "self-initiate". Of course, 'foo's __init__
will be called, as always. I've never heard the term "standing object" before.
If it's something that's obscure, or which you just made up, it could stand a
little more elaboration.
More information about the Python-list