> In dateutil, I think it's d + relativedelta(months=+1, day=1, days=-1). > Arguably, this is fairly trivial (highly non-obvious, but trivial...) Another thing that occurs to me. Presumably d + relativedelta(months=+1) + relativedelta(days=-1) is not necessarily the same as d + relativedelta(days=-1) + relativedelta(months=+1) so when you add two relativedeltas together, do you get a relativedelta that does things in the right order? In other words, can you do rd = relativedelta(days=-1) + relativedelta(months=+1) d += rd and get the same result as d += relativedelta(days=-1) d += relativedelta(months=+1) Also, there is presumably some order of precedence defined when you specify multiple adjustments in one constructor. >From your examples I'm guessing relativedelta(months=+1, days=-1) == \ relativedelta(months=+1) + relativedelta(days=-1) There could be a trap lurking here for the unwary, since obviously then relativedelta(days=-1, months=+1) != \ relativedelta(days=-1), relativedelta(months=+1) Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg at cosc.canterbury.ac.nz +--------------------------------------+
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