0

Below output shows that:

  1. the type class is the meta-class of the object class.
  2. the object class is the base class of the type class
    >>> object.__class__
    <class 'type'>
    >>>
    >>>
    >>> type.__bases__
    (<class 'object'>,)

From 1, it seems type class creates the object class so it must precede the object class.

From 2, it seems object class must exist before type class so type class can have something to inherit.

This looks like kind of a chicken-egg problem.

Anyone could shed some light on this? Thanks.

Some references:

Python object instantiation and meta-class

smwikipedia
  • 61,609
  • 92
  • 309
  • 482

0 Answers0