Paul Moore <pf_moore at yahoo.co.uk>: > dateutil.adjust(d, day=1) > dateutil.adjust(d, day=-1) > dateutil.adjust(d, day=1, months=+1, days=-1) > > Does this look any better? Yes, I think it does. At least it avoids giving any spurious impression that there might be an algebra lurking around somewhere. It might be better to have separate functions for absolute and relative adjustments, e.g. dateutil.set(d, day=1) dateutil.add(d, months=+1, days=-1) since the difference between the singular and plural keywords is rather subtle and easy to miss. 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