Another surprise from the datetime module

Dan Sommers dan at tombstonezero.net
Thu Jan 30 23:04:15 EST 2014


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.replace works, too.

*sigh*

Dan



More information about the Python-list mailing list