[Tutor] Re : Is instance of what?

Kent Johnson kent37 at tds.net
Sat Jan 31 21:00:02 CET 2009

On Sat, Jan 31, 2009 at 2:47 PM, spir <denis.spir at free.fr> wrote:

>> > o.__class__ (or rather o.__class__.__name__) will work.
>> Understood. Thank you.
>> tj
> type(a) has been changed (since 2.2?) to return the same value as a.__class__

I think you mean type(o) (type of the instance) rather than type(a)
(type of the class object).
type(o) == o.__class__ is only true if o is an instance of a new-style
class. Instances of oldstyle classes all have type 'instance'.


More information about the Tutor mailing list