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

Stephen J. Turnbull stephen at xemacs.org
Sat Mar 26 13:32:40 EDT 2016


Koos Zevenhoven writes:

 > One downside to p-strings like this is that they don't help you when
 > you have the path in a plain str variable (i.e. not a literal),

IMO that kills this simple form of the idea, since hard-coding paths
is a bad idea in many many programs, and paths are naturally derived
from user input in a host of others.  It becomes an attractive
nuisance.

How about generalizing f-strings, or perhaps giving p-strings (some
of) the power of f-strings?



More information about the Python-ideas mailing list