[Python-Dev] Updates to PEP 471, the os.scandir() proposal

Nikolaus Rath Nikolaus at rath.org
Thu Jul 10 02:25:54 CEST 2014


Ben Hoyt <benhoyt at gmail.com> writes:
> So here's the ways in which option #2 is now more complicated than option #1:
>
> 1) it has an additional "info" argument, the values of which have to
> be documented ('os', 'type', 'lstat', and what each one means)
> 2) it has an additional "onerror" argument, the signature of which and
> fairly complicated return value is non-obvious and has to be
> documented
> 3) it requires user modification of the DirEntry object, which needs
> documentation, and is potentially hard to implement
> 4) because the DirEntry object now allows modification, you need a
> stat_result() helper function to help you build your own stat values
>
> I'm afraid points 3 and 4 here add way too much complexity.

Points 3 and 4 are not required to go with option #2, option #2 merely
allows to implement points 3 and 4 at some point in the future if it
turns out to be desirable.


Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«


More information about the Python-Dev mailing list