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 flox
Recipients ezio.melotti, flox, georg.brandl, michael.foord, rhettinger
Date 2011-11-12.14:52:18
SpamBayes Score 7.882067e-11
Marked as misclassified No
Message-id <1321109539.53.0.831806439115.issue13387@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-11-12 14:52:19floxsetrecipients: + flox, georg.brandl, rhettinger, ezio.melotti, michael.foord
2011-11-12 14:52:19floxsetmessageid: <1321109539.53.0.831806439115.issue13387@psf.upfronthosting.co.za>
2011-11-12 14:52:18floxlinkissue13387 messages
2011-11-12 14:52:18floxcreate