metaclass that inherits a class of that metaclass?

Just just at xs4all.nl
Wed Jun 1 14:06:26 EDT 2005


In article <1117648438.079178.92490 at z14g2000cwz.googlegroups.com>,
 "infidel" <saint.infidel at gmail.com> wrote:

> [ ... ]  type is, from my trivial understanding, the
> base type and base metaclass for everything else in python.  Saying
> "type is an object" is only confusing you into thinking it is a
> subclass of object, which is not the case. 

Sure is:

   >>> type.__bases__
   (<type 'object'>,)

> object is a class, which I
> believe has type as it's metaclass (though I could be mistaken - this
> gets terribly confusing very quickly).

Correct:

   >>> object.__class__
   <type 'type'>

type also has type as its metaclass:

   >>> type.__class__
   <type 'type'>

In other words, type is an instance of itself.

Just



More information about the Python-list mailing list