[Python-Dev] PEP 471 (scandir): Poll to choose the implementation (full C or C+Python)

Victor Stinner victor.stinner at gmail.com
Fri Feb 13 11:33:11 CET 2015


2015-02-13 11:19 GMT+01:00 Paul Moore <p.f.moore at gmail.com>:
> On 13 February 2015 at 10:07, Victor Stinner <victor.stinner at gmail.com> wrote:
>> => IMO the best option is to take the C implementation. What do you think?
>
> FWIW (as I'm not a core dev) I agree. The Windows speedup is huge, and
> well worth adding the code. I'm assuming that the majority of the C
> code is cross-platform, so we're not adding a big chunk of code
> needing *both* Windows and C skills to maintain (any dev with C skills
> could handle it).
>
> Paul

The patch can be read here:
http://bugs.python.org/file36963/scandir-2.patch

Or using Rietveld:
http://bugs.python.org/review/22524/#ps13104

The C code is quite simple. It takes 800 lines because C code is more
"verbose" than Python code. Manipulate strings, manage memory, take
care of the reference counter, etc. just takes more lines.

Victor


More information about the Python-Dev mailing list