[Python-ideas] strptime without second argument as an inverse to __str__
Wolfgang Maier
wolfgang.maier at biologie.uni-freiburg.de
Thu Aug 7 22:40:56 CEST 2014
On 07.08.2014 19:27, Alexander Belopolsky wrote:
>
> On Thu, Aug 7, 2014 at 4:17 AM, Wolfgang Maier
> <wolfgang.maier at biologie.uni-freiburg.de
> <mailto:wolfgang.maier at biologie.uni-freiburg.de>>
> wrote:
>
>
> 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.
>
>
> No. In CPython, datetime module is implemented in C.
>
> http://hg.python.org/cpython/file/default/Modules/_datetimemodule.c
>
Just to make sure I understood things right: new additions to the
datetime module would normally be implemented in the Python version.
But then I was forgetting that your suggestion was about changing the
default constructor, which would have to happen in the C version.
Correct ?
More information about the Python-ideas
mailing list