On Tue, 29 Mar 2016 at 15:41 Koos Zevenhoven <k7hoven@gmail.com> wrote:


>> On Mar 30, 2016 01:07, "Ethan Furman" wrote:
>
>
>>> Please provide an example of both a relative and an absolute path
>>> construction using `P`.
>>
>>
>> P/'relative/path'
>>
>> P/'/absolute/path'
>
>
> Thank you.
>
> So under this system a relative path appears with one leading slash, and an absolute path appears with two leading slashes.
>
> Can't say I'm a fan.  :(
>

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.


If you are constructing a new object then you don't need to limit yourself to a single one. You could use A for absolute paths and R for relative paths:

  R/'relative'/'path'
  A/'absolute'/'path'

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'

-Brett
 

-K@mobile

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/