Florent Xicluna <florent.xicl...@gmail.com> added the comment:

At least in the standard library test suite, it should be useful.
When the test is stricter, it catches errors earlier.

I remember when assertIsInstance was made available (issue #7031), we started 
to rewrite some expressions
  self.assertEqual(type(result), str)
with
  self.assertIsInstance(result, str)

Actually, it means we relaxed the test.
Today, I don't want to use assertIsInstance anymore because I want to check the 
exact type() of the result.

The attached files list the usage of both in Lib/test/*py:
 - 325 assertIsInstance
 - 234 assert. . .type(. . .)

IMHO, some assertIsInstance can be stricter.
Most of the other type() tests can be replaced with this method.

----------
keywords: +patch
Added file: http://bugs.python.org/file23663/issue13387_exact_type.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13387>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to