Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’

Chris Angelico rosuav at gmail.com
Mon Dec 16 00:09:15 EST 2013


On Mon, Dec 16, 2013 at 3:50 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Should we expect (ignoring pathological cases) the assertion
> ‘type(obj) is obj.__class__’ to hold true? If not, under what
> circumstances would it be sensible for those to differ?

By "pathological cases", do you mean arbitrarily changing
obj.__class__, or is there some other way for them to differ?

ChrisA



More information about the Python-list mailing list