Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #62006

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

References <7wk3f5k1gm.fsf@benfinney.id.au> <l8lpp4$ito$1@ger.gmane.org> <7wfvptjt6e.fsf@benfinney.id.au>
Date 2013-12-16 16:09 +1100
Subject Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4180.1387170945.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Dec 16, 2013 at 3:50 PM, Ben Finney <ben+python@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’ Chris Angelico <rosuav@gmail.com> - 2013-12-16 16:09 +1100

csiph-web