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

Ben Hoyt benhoyt at gmail.com
Wed Jul 9 21:59:39 CEST 2014


>> 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.
>
>
> I'm okay with dropping 3 and 4, and making the return from onerror being
> simply True to yield the entry, and False/None to skip it.  That should make
> implementation much easier, and documentation not too strenuous either.

That's definitely better in terms of complexity.

Other python-devers, please chime in with your thoughts or votes.

-Ben


More information about the Python-Dev mailing list