How do I do this without class methods ?

Alex Martelli aleaxit at yahoo.com
Thu May 3 05:46:05 EDT 2001


"Courageous" <jkraska1 at san.rr.com> wrote in message
news:t3f1ft4296m7gltkc554gr3dsmedgfjh9k at 4ax.com...
>
> >I think a regular function taking the class object as an argument
> >is simplest.
>
> But not necessary, as the class of the object can be determined with
> a single call at runtime.

If I recall correctly the context, which you have totally snipped,
one of the issues of the original poster was being able to do
such manipulations *WITHOUT* necessarily having an instance object
around (nor having to instantiate one artificially for that).

Under such reasonable constraints, it IS necessary for the class
object to be determined otherwise than as the .__class__ attribute
of some instance object ('single call'?  what call?).  It still
seems to me that passing the class object as the argument to a
regular function IS simplest (and necessary to avoid needing an
instance object, OR complications such as the 'static non-function
callables as class attributes' idiom).


Alex






More information about the Python-list mailing list