[Python-Dev] A small patch. (original) (raw)

Skip Montanaro skip at pobox.com
Wed Nov 6 21:39:17 CET 2013


- assert 1 <= month <= 12, month + assert 1 <= month <= 12, 'month must be in 1..12'

In addition to Brett's comment, you might as well include the offending value in your AssertionError message. For example, a value of 0 probably tells you something different about your underlying bug than a value of 2013. Just knowing it's out of range isn't really enough.

Skip



More information about the Python-Dev mailing list