Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65077 > unrolled thread
| Started by | Cameron Simpson <cs@zip.com.au> |
|---|---|
| First post | 2014-01-31 13:01 +1100 |
| Last post | 2014-01-31 13:01 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Another surprise from the datetime module Cameron Simpson <cs@zip.com.au> - 2014-01-31 13:01 +1100
| From | Cameron Simpson <cs@zip.com.au> |
|---|---|
| Date | 2014-01-31 13:01 +1100 |
| Subject | Re: Another surprise from the datetime module |
| Message-ID | <mailman.6186.1391133711.18130.python-list@python.org> |
On 31Jan2014 11:35, Ben Finney <ben+python@benfinney.id.au> wrote: > Cameron Simpson <cs@zip.com.au> writes: > > Hmm. I do not like the replace() as suggested. > > > > Firstly, replace is a verb, and I would normally read > > td.replace(microseconds=0) as an instruction to modify td in place. > > Traditionally, such methods in python return None. > > I agree with this objection. A method that is named “replace”, yet does > not modify the object, is badly named. > > However, the existing ‘replace’ methods ‘datetime.date.replace’, > ‘datetime.datetime.replace’, ‘datetime.time.replace’ already work this > way: they create a new value and return it, without modifying the > original object. Ah. -- Cameron Simpson <cs@zip.com.au> DRM: the functionality of refusing to function. - Richard Stallman
Back to top | Article view | comp.lang.python
csiph-web