Implement C's Switch in Python 3

Avi Gross avigross at
Sun Feb 3 18:52:14 EST 2019

Comment at end:

-----Original Message-----
From: Python-list < at> On Behalf Of Bob van der Poel
Sent: Sunday, February 3, 2019 4:01 PM
To: DL Neil <PythonList at>
Cc: Python <python-list at>
Subject: Re: Implement C's Switch in Python 3


I'm surprised that no one has yet addressed the year 10000 problem.
Hopefully we're doing numeric, not alpha sorts on the stuff before the 1st '-'. And, the compact versions will really screw up :).

[[The obvious solution is to list all dates in the sortable format like this for January 2nd, 2020:


Without the 0Q we might just assume it was written in base 3, or trinary.

OK, turning sarcasm mode off.

It is very bad form to have ambiguous compressed formats. Even if you include a slash or minus sign or period or the delimiter of your choice, I sometimes see this:


And I wonder if it is meant to be January 2nd or February 1st.

Clearly 30/01/2020 cannot be the 30th month so it must be an alternate format. And, years from now, we may get a year that might confuse us more if compressed like:


Is that 2112 as the year an Dec 21? 

In the interest of clarity,  how is this different than including a time zone alongside a time value? Maybe '0Q" is silly, but a prefix or suffix or even a new delimiter might be a good idea. Are any available?

2020|12|02 ???

The end]]

More information about the Python-list mailing list