This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients Luc Saffre, docs@python, steven.daprano, terry.reedy
Date 2015-06-26.22:15:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20150626221442.GW20701@ando.pearwood.info>
In-reply-to <1435353618.07.0.903720805027.issue24515@psf.upfronthosting.co.za>
Content
On Fri, Jun 26, 2015 at 09:20:18PM +0000, Terry J. Reedy wrote:

> I agree that the tuple explanation if ok.  But "Return whether an 
> object is an instance of a class or of a subclass thereof." (3.5) 
> seems wrong.  I believe 'subclass' should be 'superclass'.

No, the current description is correct.

> >>> class C: pass
> >>> class Csub(C): pass
> >>> isinstance(C(), Csub)
> False

In this case, the instance C() is an instance of a *superclass* of 
Csub, and isinstance returns False.

> >>> isinstance(Csub(), C)
> True

In this case, the instance Csub() is an instance of a *subclass* of C, 
and isinstance returns True.
History
Date User Action Args
2015-06-26 22:15:00steven.dapranosetrecipients: + steven.daprano, terry.reedy, docs@python, Luc Saffre
2015-06-26 22:15:00steven.dapranolinkissue24515 messages
2015-06-26 22:15:00steven.dapranocreate