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
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