A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-March/043139.html below:

[Python-Dev] dateutil

[Python-Dev] dateutil [Python-Dev] dateutilChristian Tanzer tanzer at swing.co.at
Mon Mar 15 12:28:00 EST 2004
> > Why don't you use "d + relativedelta(day=-1)" instead?
> >
> > Just as easy to use, better error detection, and a big precedent.
>
> Supporting this might be cool indeed. OTOH, it doesn't replace the
> current behavior. How do you get (day=30)?

I don't follow. The semantics would be similar to list indexing.

`day=30` asks for the 30-est day of the month and raises an ValueError
if there isn't any. `day=-1` asks for the last day of the month (and
should never raise an error <wink>).

The allowed argument range for `day` would be between 1 and `n` with
`n` the number of days in the month for positive values and between -1
and `-n` for negative values.

-- 
Christian Tanzer                                    http://www.c-tanzer.at/


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