[Python-ideas] Making datetime __str__ and isoformat more consistent

Ethan Furman ethan at stoneleaf.us
Sat Nov 2 03:02:31 CET 2013


On 11/01/2013 06:52 PM, Andrew Barnert wrote:
> On Nov 1, 2013, at 17:36, Alexander Belopolsky wrote:
>> On Fri, Nov 1, 2013 at 8:28 PM, Andrew Barnert wrote:
>>>
>>> What about just adding a fromisoformat classmethod constructor that's meant specifically for round tripping isoformat?
>>
>> What about following the lead of int(), float(), etc. and allow datetime() take a single string argument?
>
> [snip]
>
> Finally, I'd be happy with a fromisoformat that _only_ handled the output from the isoformat function [snip]

I'd be happy with having __new__ accept a string in whatever format __str__ outputs (not isoformat or anything else, 
just __str__).

--
~Ethan~


More information about the Python-ideas mailing list