[Python-ideas] URLs/URIs + pathlib.Path + literal syntax = ?

Ethan Furman ethan at stoneleaf.us
Tue Mar 29 11:31:46 EDT 2016


On 03/29/2016 07:42 AM, Koos Zevenhoven wrote:

> While I think that the decisions about p-strings (or a-strings for
> addresses or whatever they should be) should keep URIs in mind, it is
> premature to add the Path+URI fusion into the stdlib. I agree with
> Paul Moore that this URL stuff should be on PyPI first. It could even
> be library that monkey patches pathlib to accept URIs. Or a URI
> library that instantiates Path objects when appropriate. Then there
> could be a smooth transition into the stdlib some day.

Pathlib is already complicated; unless we would be doing the same types 
of operations, and have the same mental model, there would be no point 
in trying to support URIs with Pathlib.

If (a big if) we do add URI support, there would be no danger of mixing 
file paths with URI paths as you must specify which one you want:

- WindowsPath
- PosixPath
- UriPath

--
~Ethan~


More information about the Python-ideas mailing list