Search⌘ K

The Chicken and Egg Problem

Understand Python's complex chicken and egg problem involving the object and type classes. Learn how these classes are instances of each other, why this relationship cannot be replicated purely in Python, and how Python implements this to maintain its flexible type system.

We'll cover the following...

Let’s ask the million-dollar question again: which came first, the chicken or the egg?

I think both fell from the sky at the same time. But what does this have to do with Python? Well, you will find out soon.

1.

Can you find the "ultimate" base class?
Python 3.5
print(isinstance(3, int))
print(isinstance(type, object))
print(isinstance(object, type))

So which is the “ultimate” base class? There’s more to this confusion, by the way.

2.

...