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/043150.html below:

[Python-Dev] dateutil

[Python-Dev] dateutil [Python-Dev] dateutilAahz aahz at pythoncraft.com
Mon Mar 15 19:28:05 EST 2004
On Tue, Mar 16, 2004, Greg Ewing wrote:
> Gustavo Niemeyer <niemeyer at conectiva.com>:
>> 
>> (just as examples)
>> 
>> d + relativedelta(day=1)
>> d + relativedelta(day=31)
> 
> Sorry, but the more I see of this usage the worse it looks. Here
> you're effectively using '+' as an assignment operator. To me, that's
> a gross abuse of the Python language.

Part of the problem is that relativedelta does need to be a single
complex object.  Consider

today() + relativedelta(month=1, dayofweek=FRIDAY)

contrasted with

today() + relativedelta(weeks=4, dayofweek=FRIDAY)

Humans use complex relative date constructs, and many of them depend on
whatever the base time is; in order to do the adjustment correctly, you
need to provide a single change construct.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"usenet imitates usenet"  --Darkhawk

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