Find in ipython3

Chris Angelico rosuav at gmail.com
Sun Jun 7 08:13:54 EDT 2015


On Sun, Jun 7, 2015 at 8:27 PM, Peter Otten <__peter__ at web.de> wrote:
> Just wait for Python 3.5. The switch from os.listdir() to the (new)
> os.scandir() in the implementation of os.walk() is likely to improve the
> situation

Why wait? I've been using 3.5 for ages (and actually, my
/usr/local/bin/python3 now announces itself as 3.6), and the betas
have been available with all the regular installers. Python betas are
pretty stable, and apart from a few glitches with the installers on
Windows, I haven't heard any showstopper bugs. Aside from not
depending on them for your nuclear power plant safety systems, there's
not a lot that the betas can't be used for.

Mind you, a lot of the benefit of os.scandir() comes from its
behaviour across network mounts and such, which is why you're seeing
no more than about a 2:1 difference here. From what I gather, the
improvement across network can be simply amazing (because of the way
os.listdir has to stat everything separately).

ChrisA



More information about the Python-list mailing list