On 26.03.2016 20:53, Koos Zevenhoven wrote:
Yes, some of the properties could have more logical names like .remove() instead of .unlink(), and there could be even more functionality. Subclassing from str would have obvious benefits, but I'm just not sure whether it's a good idea to inherit things like str.find, str.splitlines, str.title, ...
So maybe the best thing is not to inherit from str but to make Path quack as much like a str-duck as possible (and vice versa?) without introducing confusing things?
I would not like this limitation. Paths are strings (even for the os). It's just that Python devs are terribly lazy so, they want a string deluxe instead of a plain string in case a string represents a path.
A lot of companies encode data right into the path of some files. So, when dealing with such situation, I would very like to have all capabilities of str available. Everything else would be frustrating IMHO.