Steven D'Aprano writes:
> On Fri, 31 Jan 2014 11:35:14 +1100, Ben Finney wrote:
>
> > Cameron Simpson writes:
> >> 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
On Fri, 31 Jan 2014 11:35:14 +1100, Ben Finney wrote:
> 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.
That's how str.r
In article <52eb1e37$0$29972$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> "replace" is a perfectly reasonable name for a method which performs a
> replacement, whether it replaces in place (for mutable objects) or makes
> a copy with replacement (for immutable objects). What e
On Fri, 31 Jan 2014 11:35:14 +1100, Ben Finney wrote:
> Cameron Simpson 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
On 31Jan2014 11:35, Ben Finney wrote:
> Cameron Simpson 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
Cameron Simpson 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
On 30Jan2014 18:36, Neil Cerutti wrote:
> On 2014-01-30, Roy Smith wrote:
> > I was astounded just now to discover that datetime.timedelta
> > doesn't have a replace() method (at least not in Python 2.7).
> > Is there some fundamental reason why it shouldn't, or is this
> > just an oversight?
> >
On 2014-01-30, Roy Smith wrote:
> I was astounded just now to discover that datetime.timedelta
> doesn't have a replace() method (at least not in Python 2.7).
> Is there some fundamental reason why it shouldn't, or is this
> just an oversight?
>
> My immediate use case was wanting to print a timed
On 30/01/2014 17:32, Roy Smith wrote:
I was astounded just now to discover that datetime.timedelta doesn't
have a replace() method (at least not in Python 2.7). Is there some
fundamental reason why it shouldn't, or is this just an oversight?
My immediate use case was wanting to print a timedelt