A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-January/107267.html below:

[Python-Dev] Checking input range in time.asctime and time.ctime

[Python-Dev] Checking input range in time.asctime and time.ctime [Python-Dev] Checking input range in time.asctime and time.ctimeAlexander Belopolsky alexander.belopolsky at gmail.com
Thu Jan 6 03:46:49 CET 2011
On Wed, Jan 5, 2011 at 9:18 PM, Guido van Rossum <guido at python.org> wrote:
> I'm sorry, but at this point I'm totally confused about what you're
> asking or proposing. You keep referring to various implementation
> details and behaviors. Maybe if you summarized how the latest
> implementation (say python 3.2) works and what you propose to change

I'll try.  The current implementation is of time.asctime and
time.strftime is roughly

if y < 1900:
    if accept2dyear:
        if 69 <= y <= 99:
            y += 1900
        elif 0 <= y <= 68:
            y += 2000
        else:
            raise ValueError("year out of range")
    else:
         raise ValueError("year out of range")
# call system function with tm_year = y - 1900

I propose to change that to

if y < 1000:
    if accept2dyear:
        if 69 <= y <= 99:
            y += 1900
        elif 0 <= y <= 68:
            y += 2000
        else:
            raise ValueError("year out of range")
# call system function with tm_year = y - 1900
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4