[Python-ideas] Working with Path objects: p-strings?

Chris Angelico rosuav at gmail.com
Tue Mar 29 03:27:09 EDT 2016


On Tue, Mar 29, 2016 at 6:22 PM, Sven R. Kunze <srkunze at mail.de> wrote:
> Thinking more about it, that would even come in nicely with path separators:
>
> p'/{whereever}/{youwant}/{togo}'
>
> That'll finally an easy-to-write and readable path generation. Great idea,
> Stephen.

Agreed, although this introduces a new edge case: what if 'togo'
contains a slash? Should this raise an exception, or should it be
interpreted as a multi-part path component? Arguments can be put for
both sides.

But it's pretty cool.

ChrisA


More information about the Python-ideas mailing list