[issue19562] Added description for assert statement

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you for the explanation. If the style comment is not in the file already, you might add it whenever you next edit the file for substantive purposes (a real bug or feature change). Ditto for _DI4Y. -- ___ Pytho

[issue19562] Added description for assert statement

2013-12-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: @terry - datetime.py was originally written as a prototype for the C code and many seemingly unpythonic constructs therein are motivated by the desire to ease the translation to C. I would not mind simplifying _DI4Y calculation as you suggest, but please

[issue19562] Added description for assert statement

2013-12-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am going to reject this. Assert failures should never be seen by users and for a developer "assert 1 <= month <= 12" is as clear as "month must be in 1..12." -- nosy: +belopolsky resolution: -> wont fix stage: -> committed/rejected status: o

[issue19562] Added description for assert statement

2013-11-15 Thread Terry J. Reedy
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.

[issue19562] Added description for assert statement

2013-11-15 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.4 -Python 2.7, Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue19562] Added description for assert statement

2013-11-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Since failed asserts print the failed assert, repeating the assertion in a message is useless. >>> assert 1 <= i Traceback (most recent call last): File "", line 1, in assert 1 <= i AssertionError It is already obvious that i must be >= 1. So I would rej

[issue19562] Added description for assert statement

2013-11-12 Thread Srinivas Reddy T
New submission from Srinivas Reddy T: Added descriptive message to assert statement in datetime module. Since _check_date_fields does the job of data integrity, i did not check for ValueError, TypeError checks in the function. However, i am not sure of the adding descriptive messages to the ot