Is there anything in the script which could cause it to not run its full course please?

Cameron Simpson cs at cskk.id.au
Tue May 5 04:43:18 EDT 2020


On 04May2020 17:17, ozstar1 at gmail.com <ozstar1 at gmail.com> wrote:
>On Tuesday, 5 May 2020 01:35:42 UTC+10, David Raymond  wrote:
>> Not necessarily the cause of your problem, but if you're going to compare dates it should be as objects, or as text as year-month-day. Here you're comparing dates as text in day-month-year format. So January first 9999 comes before May 4th 2020
>>
>> "01-01-9999" < "04-05-2020"
[...]
>
>Thank you, see what you mean. I have corrected this now.

It seem worth pointing out that this is why many of us like ISO8601 
dates, which are written from largest component to smallest component.  
For example:

    2020-05-04

They have the convenient property of sorting lexically as they would 
sort numerically.

But David's right on in saying that if you're comparing numbers, do it 
numerically. Comparing text when the underlying thing isn't text is the 
wrong approach.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list