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

Ethan Furman ethan at stoneleaf.us
Wed Jul 9 20:29:50 CEST 2014


On 07/09/2014 11:04 AM, Paul Moore wrote:

On 9 July 2014 17:35, Ethan Furman <ethan at stoneleaf.us> wrote:

More specifically, if we go with choice 1 (no built-in error handling, no mutable DirEntry), how would I implement choice 2? Would I have to write my own CustomDirEntry object? Having built-in error handling is, I think, a key point. That's where #1 really falls down. But a mutable DirEntry and/or letting onerror manipulate the result is a lot more than just having a hook for being notified of errors. That seems to me to be a step too far, in the current context. Specifically, the tree size example doesn't need it. Do you have a compelling use case that needs a mutable DirEntry? It feels like YAGNI to me.

Not at this point. As I indicated in my reply to your response, as long as we have the onerror machinery now we can tweak it later if real-world use shows it would be beneficial.

-- Ethan



More information about the Python-Dev mailing list