[issue19562] Added description for assert statement

Terry J. Reedy report at bugs.python.org
Sat Nov 16 02:51:44 CET 2013


Terry J. Reedy added the comment:

Looking further, the current code has a message object, the month that fails the test and your patch removes that in adding the redundant message. I also see that your change would make the first assert match the next 2. But I would rather change the next two.

Sequences like
_DI4Y   = _days_before_year(5) 
# A 4-year cycle has an extra leap day over what we'd get from pasting
# together 4 single years.
assert _DI4Y == 4 * 365 + 1

are bizarre. The constant should be directly set to 4*365 + 1 and then _days_before_year(5) == _DI4Y tested in test_datetime.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19562>
_______________________________________


More information about the Python-bugs-list mailing list