[Python-Dev] iso8601 parsing

Elvis Pranskevichus elprans at gmail.com
Tue Oct 24 20:11:43 EDT 2017


On Tuesday, October 24, 2017 5:53:58 PM EDT Alexander Belopolsky wrote:
> No, but the last time I suggested that that datetime types should
> satisfy the same invariants as numbers, namely
> T(repr(x)) == x, the idea was met will silence.  I, on the other hand,
> am not very enthusiastic about named constructors such as
> date.isoparse().  Compared with date(s:str), this is one more method
> name to remember, plus the potential for abuse as an instance method.
> What is d.isoparse('2017-11-24')?

Agreed.  datetime(s:str) seems like a far more natural and consistent 
choice.

                                 Elvis


More information about the Python-Dev mailing list