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 terry.reedy
Recipients terry.reedy, thatiparthy
Date 2013-11-16.00:57:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384563450.45.0.729620584898.issue19562@psf.upfronthosting.co.za>
In-reply-to
Content
Since failed asserts print the failed assert, repeating the assertion in a message is useless.
>>> assert 1 <= i
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    assert 1 <= i
AssertionError

It is already obvious that i must be >= 1. So I would reject the patch.

> And isn't this too much defensive programming?

Whether stdlib python code should have asserts is a more interesting question. I will ask on pydev.
History
Date User Action Args
2013-11-16 00:57:30terry.reedysetrecipients: + terry.reedy, thatiparthy
2013-11-16 00:57:30terry.reedysetmessageid: <1384563450.45.0.729620584898.issue19562@psf.upfronthosting.co.za>
2013-11-16 00:57:30terry.reedylinkissue19562 messages
2013-11-16 00:57:30terry.reedycreate