[Python-ideas] Promoting the adoption of pathlib [Was: Working with Path objects: p-strings?]

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 31 16:44:16 EDT 2016


Paul Moore wrote:
>     In function xxx, please support passing a pathlib.Path for
> argument bar. This can be done
>     simply by adding a line
>         bar = getattr(bar, 'path', bar)

This is a rather ugly piece of code to have to sprinkle
all over any library that deals with pathnames.

I don't get a good feeling about this approach. It seems
like it will be a spreading infection that only gets
worse over time.

-- 
Greg


More information about the Python-ideas mailing list