Re: [Python-Dev] A small patch.

2013-11-06 Thread Alexander Belopolsky
On Wed, Nov 6, 2013 at 3:43 PM, Antoine Pitrou wrote: > Besides, if it's an assertion it's only an internal helper to check > implementation correctness. If it's an error that can be caused by > erroneous user data, it should be replaced with the proper exception class > (perhaps ValueError). A

Re: [Python-Dev] A small patch.

2013-11-06 Thread Antoine Pitrou
Le 06/11/2013 21:39, Skip Montanaro a écrit : -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 som

Re: [Python-Dev] A small patch.

2013-11-06 Thread Skip Montanaro
> -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 th

Re: [Python-Dev] A small patch.

2013-11-06 Thread Brett Cannon
Please put all patches on bugs.python.org, else we will lose track of the change. On Wed, Nov 6, 2013 at 2:17 PM, Sreenivas Reddy T < thatiparthysreeni...@gmail.com> wrote: > diff -r bec6df56c053 Lib/datetime.py > --- a/Lib/datetime.pyTue Nov 05 22:01:46 2013 +0200 > +++ b/Lib/datetime.py