
On Sat, Jul 10, 2021 at 09:21:14AM -0000, Thomas Grainger wrote:
It's a utility method, so its usefulness derives from being available everywhere without having to patch it in.
Don't mistake *convenience* with *usefulness*. It is convenient to have the functionality in the std lib, especially for those who are limited to only using the std lib without third party libraries. But it is no more useful. If the functionality is the same, it makes no difference whether it was in pathlib.Path, patched in, subclassed or imported from a library. The usefulness of this method to *you* does not depend on whether other people have access to it or not. Remember too that even if we agreed right now that this was an awesome idea, the earliest that it could appear in production would be 3.11. So you can't rely on it being in the std lib until you can stop using 3.10 and below. Until then, you have to rely on a subclass or monkey-patch. If this method was hard to write correctly, that would be a good argument for adding it to pathlib. But you literally gave an implementation for this method and it was only a few lines long, so not difficult for people to write themselves. So far, at least, it doesn't seem to have attracted much interest from other people saying "oh yes, that would be really useful", so it seems that the usefulness is very niche. That makes it hard to justify complicating the pathlib API with an extra method if hardly anyone is going to use it. Put all of those together: - you can't use it until you have abandoned 3.10 and older; - not many other people seem interested, including the pathlib maintainers; - it seems to be easy enough to implement yourself; and the convenience argument isn't very strong. If you're going to push this, I think you need a stronger justification.
For me what's changed is the introduction of `asyncio.to_thread` and PEP 597 making `pathlib.Path.open` slightly less ergonomic,
I don't know what you mean by ergonomic when it comes to software. Obviously you're not implying that it is physically harder to type "pathlib.Path.open" now, so I don't know what you mean. -- Steve