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 ezio.melotti
Recipients docs@python, eric.araujo, eric.snow, ezio.melotti, flox, georg.brandl, michael.foord, pitrou, python-dev, rhettinger
Date 2011-11-18.17:15:32
SpamBayes Score 2.2720539e-07
Marked as misclassified No
Message-id <1321636533.62.0.452991276521.issue13387@psf.upfronthosting.co.za>
In-reply-to
Content
> + To check for a specific type (without including superclasses) use
> + :func:`assertIs(type(obj), cls) <assertIs>`.
>
> Don’t you mean “without accepting subclasses”, not superclasses?

I mean:
>>> class MyInt(int): pass     # my specific type
...
>>> isinstance(MyInt(5), int)  # int superclass included
True
>>> type(MyInt(5)) is int      # int superclass not included
False
>>> type(MyInt(5)) is MyInt    # check for specific type
True

Do you think I should rephrase it (or maybe just remove the (...))?
History
Date User Action Args
2011-11-18 17:15:33ezio.melottisetrecipients: + ezio.melotti, georg.brandl, rhettinger, pitrou, eric.araujo, michael.foord, flox, docs@python, python-dev, eric.snow
2011-11-18 17:15:33ezio.melottisetmessageid: <1321636533.62.0.452991276521.issue13387@psf.upfronthosting.co.za>
2011-11-18 17:15:33ezio.melottilinkissue13387 messages
2011-11-18 17:15:32ezio.melotticreate