A RetroSearch Logo

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

Search Query:

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

[Python-Dev] Re: dateutil

[Python-Dev] Re: dateutilGreg Ewing greg at cosc.canterbury.ac.nz
Mon Mar 15 19:50:07 EST 2004
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	   +--------------------------------------+

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