[Python-ideas] Working with Path objects: p-strings?
Ethan Furman
ethan at stoneleaf.us
Wed Mar 30 12:49:12 EDT 2016
On 03/30/2016 08:18 AM, Paul Moore wrote:
> And of course code that has to deal with *both* Path and string
> objects (for compatibility reasons) can easily enough handle anything
> it receives, but has a decision to make about what to return - if it
> returns Path objects, it won't be backward compatible. But if it
> returns string objects, we'll never get away from the need to convert
> strings to paths in our code at some point.
A solution here is to return what you receive:
- str coming in? str going out
- path coming in? path going out
Of course, this gets muddied when multiple path/str arguments are
accepted coming in.
--
~Ethan~
More information about the Python-ideas
mailing list