
On Wed, Mar 30, 2016 at 1:49 AM, Brett Cannon brett@python.org wrote:
On Tue, 29 Mar 2016 at 15:41 Koos Zevenhoven k7hoven@gmail.com wrote:
I'll have to agree. But to be fair, Greg wrote something like 'a suitable seed object' so we could for ex. have P=PathSeed(), and use another operator.
P@'rel/path'
P@'/abs/path'
Dunno.
[...]
Or even P.absolute and P.relative:
P.relative/'relative'/'path' P.absolute/'absolute'/'path'
And you could even go as far as make one the default and the other not to promote one over the other:
P.relative/'relative'/'path' P/'absolute'/'path'
The trick is, again, that the path is often in a variable coming from user input etc. and you don't (want to) deal with whether it is relative or absolute. This also still has a slash before relative paths too.
Another thing is that, while / looks very nice, it makes you have to use parentheses when you want to directly call a method on the path:
(somedir / relative_file_path).method()
We have been making examples with /many/'path'/'objects'/joined_together. But how often do people really join more than two paths at once?
Sometimes, in interactive sessions, I have wished for this to work:
somedir(relative_file_path).method()
...which is kind of stupid ;)
- Koos