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

Paul Moore p.f.moore at gmail.com
Tue Mar 29 17:57:09 EDT 2016


On 29 March 2016 at 22:00, Sven R. Kunze <srkunze at mail.de> wrote:
> However, something that I cannot leave uncommented is "suboptimal
> representation for paths". What would your optimal representation for paths
> look like? I cannot believe that the current representation is so bad and
> has been for so long and nobody, really nobody, has anything done about it.

Well, pathlib.Path :-)

The point here is that C's char* representation is a serialisation of
a path object, just like 123 is a serialisation of an integer object.
We don't object to having to convert user input to a string if we need
to, why object to having to convert it to a Path if appropriate?

Paul


More information about the Python-ideas mailing list