[Python-ideas] strptime without second argument as an inverse to __str__

Skip Montanaro skip at pobox.com
Mon Aug 4 21:00:17 CEST 2014


On Mon, Aug 4, 2014 at 1:40 PM, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> Why is this question relevant for Ram's proposal?

It would seem to have some impact on how hard it is to create a
general inverse. Will one format work for all platforms ("one and
done"), or will the inverse implementation potentially have to be
updated as new platforms come into (or go out of) existence?

Also, would the creation of such an inverse lock the implementation
into existing format(s)? For example, when fed a datetime object, the
CSV module will stringify it for output. If I create a CSV file with
one version of Python, then read it into another version of Python (or
on a different platform), it's not unreasonable that I would expect
one-argument strptime() to parse it. That would lock you into a
specific format. If only one format exists today, no big deal, bless
it and move on.

Skip


More information about the Python-ideas mailing list