On 31Jan2014 11:35, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > Cameron Simpson <c...@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 <c...@zip.com.au> DRM: the functionality of refusing to function. - Richard Stallman -- https://mail.python.org/mailman/listinfo/python-list