"Brian Quinlan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> There is a difference between everything being an object and everything
> being an instance of a class. In Python, every runtime entity is an
> object but not everything is a class instance.

However, everything is an instance of a class or type.  And once old-style 
classes are dropped, all classes will be user-defined types and types will 
be built-in classes.  And it seems that for instances of such unified 
type-classes, type(x) == x.__class__:
>>> type(int)
<type 'type'>
>>> int.__class__
<type 'type'>
>>> class c(object): pass
...
>>> c1 = c()
>>> type(c1)
<class '__main__.c'>
>>> c1.__class__
<class '__main__.c'>
# don't know if user metaclasses can change this or not

So the distinction, if kept, will be pretty thin.

Terry J. Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to