[Python-ideas] Adding `pathlib.Path` method that would send file to recycle bin
abarnert at yahoo.com
Fri Jan 2 20:46:51 CET 2015
On Jan 2, 2015, at 14:24, random832 at fastmail.us wrote:
> On Tue, Dec 30, 2014, at 18:12, Andrew Barnert wrote:
>> By "suitable" I mean "suitable for widespread-enough use that it should
>> be in the stdlib". As I said earlier in the thread, I think it's
>> perfectly reasonable to have a third-party library that uses a deprecated
>> API, requires 10.8, requires a runloop, directly or indirectly asks the
>> Finder to do the work for you, or doesn't quite meet Apple's HIG rules,
>> because all of those could be acceptable in _many_ applications; I just
>> don't think any of those should be in the stdlib, because none of those
>> are acceptable in _most_ applications.
> Not having one isn't acceptable either. Because what _not_ having a
> cross-platform wrapper gets you is windows and mac left behind by
> applications with badly-written direct implementations of the way you do
> it on Unix.
I'm not sure what "the way you do it on Unix" means. There is no Unix/POSIX/etc. notion of trashing a file. Of course some Unix desktop environments (going back at least as far as NeXTStep) have had such a thing, but that can't be what you mean. If you're referring to XDG, I don't know of a single application that uses a badly-written direct implementation of the XDG trash spec on Mac or Windows. Do you?
More importantly, which of those other options do you think is better than continuing to have no trash API? Drop 10.6-10.7 compat? Use a deprecated API and break Mac App Store compatibility? Require all scripts to have a runloop?
> Can you define "doesn't quite meet Apple's HIG" rules and link the
> relevant section of the HIG?
Of course not, because I have no idea what exactly you'd write in place of calling the appropriate API. Give me a design or some code, and I'll tell you what it does wrong.
More information about the Python-ideas