Everything is an object in python - object class and type class

Terry Reedy tjreedy at udel.edu
Tue Jun 2 12:23:19 EDT 2015


On 6/2/2015 6:36 AM, Eddilbert Macharia wrote:

> you guys are just confusing me, you are going in loops,

Ignore the troll who is trying to confuse you by slandering the rest of 
us.  I have been using python for 18 years, I believe. Current Python 
has a loop at the core

 >>> isinstance(type, object)
True
 >>> isinstance(object, type)
True

For using python, you hardly need to know this. (It obviously was not 
true before 'object' was added in 2.2.)  The interpreter creates this 
loop on startup with code similar to the following, except that it does 
so with classes rather than lists.

 >>> lob = []
 >>> l0 = []
 >>> l1 = [l0]
 >>> l0.append(l1)
 >>> l0 in l1
True
 >>> l1 in l0
True

 > and still i have understood ,what makes everything in python an object.

Guido's decision to make python be that way.

-- 
Terry Jan Reedy




More information about the Python-list mailing list