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

Wolfgang Maier wolfgang.maier at biologie.uni-freiburg.de
Thu Aug 7 10:17:13 CEST 2014


On 07.08.2014 02:29, Alexander Belopolsky wrote:
>
> On Wed, Aug 6, 2014 at 7:55 PM, Andrew Barnert
> <abarnert at yahoo.com
> <mailto:abarnert at yahoo.com>> wrote:
>
>     More readable maybe, but more efficient? You're doing the same work,
>     plus string parsing; you're eliminating two parameters (but only if
>     you use *args) at the cost of three locals; by any measure it's less
>     efficient.
>
> Since parsing will be done in C, it's cost can be made negligible.  In
> implementations other than CPython, YMMV.
>

Why would parsing occur in C ? The datetime module is implemented in 
pure Python.



More information about the Python-ideas mailing list