Should Python documentation for __class__ be improved?
spamfranke at bigfoot.de
Wed Mar 15 02:38:03 CET 2000
On Tue, 14 Mar 2000 18:28:51 -0500, Tom Funk
<_spam_sux_tdfunk at _spam_sux_nettally.com> wrote:
> o when called it creates a new instance of the class
> is the same as
>(Pretty cool stuff, Guido! :-)
Hmm, is this case, yes, but not generally:
creates an instance of self's class even in derived classes,
(descendants of 'Class') whereas
creates only instances of 'Class' itself. This trick makes Guido's
implementation even a bit cooler than you'd figured out by now..
>So, what __class__ *really* is, is:
a reference to a *class object*, which is a first order object like
integers, strings and functions too. That means they can be assigned
or passed as parameters/return values or computed by an expression
like any other value in Python.
More information about the Python-list