A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-February/138212.html below:

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

[Python-Dev] PEP 471 (scandir): Poll to choose the implementation (full C or C+Python) [Python-Dev] PEP 471 (scandir): Poll to choose the implementation (full C or C+Python)Serhiy Storchaka storchaka at gmail.com
Fri Feb 13 11:52:36 CET 2015
On 13.02.15 12:07, Victor Stinner wrote:
> TL,DR: are you ok to add 800 lines of C code for os.scandir(), 4x
> faster than os.listdir() when the file type is checked?

You can try to make Python implementation faster if

1) Don't set attributes to None in constructor.

2) Implement scandir as:

def scandir(path):
     return map(partial(DirEntry, path), _scandir(path)).

3) Or pass DirEntry to _scandir:

def scandir(path):
     yield from _scandir(path, DirEntry)


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4