Diez B. Roggisch wrote:
But not everything is a newstyle-class:
class Foo: pass
...
isinstance(Foo, object)
True
isinstance(Foo, type)
False
class Bar(object): pass
...
isinstance(Bar, type)
True
thx for explanation. but more I look at it less and
En Tue, 22 Apr 2008 00:49:27 -0300, AlFire
[EMAIL PROTECTED] escribió:
Diez B. Roggisch wrote:
But not everything is a newstyle-class:
class Foo: pass
...
isinstance(Foo, object)
True
isinstance(Foo, type)
False
class Bar(object): pass
...
isinstance(Bar, type)
True
thx
Hi,
Q: from the subject, why objects of old style classes are instances of
'object'?
class a():pass
A=a()
isinstance(A,object)
True
I would expect False
Thx,
Andy
--
http://mail.python.org/mailman/listinfo/python-list
AlFire wrote:
Hi,
Q: from the subject, why objects of old style classes are instances of
'object'?
class a():pass
A=a()
isinstance(A,object)
True
Because everything is an object.
But not everything is a newstyle-class:
class Foo: pass
...
isinstance(Foo, object)
True