[Python-checkins] cpython (2.7): #13387: add note about checking the exact type in assertIsInstance doc.
ezio.melotti
python-checkins at python.org
Fri Nov 18 18:01:09 CET 2011
http://hg.python.org/cpython/rev/fd9d7a8e45bc
changeset: 73614:fd9d7a8e45bc
branch: 2.7
parent: 73611:0fdf7f7c353d
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Fri Nov 18 18:59:36 2011 +0200
summary:
#13387: add note about checking the exact type in assertIsInstance doc.
files:
Doc/library/unittest.rst | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -895,6 +895,8 @@
Test that *obj* is (or is not) an instance of *cls* (which can be a
class or a tuple of classes, as supported by :func:`isinstance`).
+ To check for a specific type (without including superclasses) use
+ :func:`assertIs(type(obj), cls) <assertIs>`.
.. versionadded:: 2.7
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list