[Python-ideas] Better stdlib support for Path objects

Juancarlo Añez apalala at gmail.com
Tue Oct 7 15:25:11 CEST 2014


On Tue, Oct 7, 2014 at 8:03 AM, Wolfgang Maier <
wolfgang.maier at biologie.uni-freiburg.de> wrote:

> then call str() on all input that passes an isinstance(input, Path) check,
> raise an error otherwise.


Calling:

    path=str(path)

within all API functions that accept file paths is a good enough solution,
and one that doesn't change dependencies in stdlib.

Most of the API functions I've had to call with str(path) don't return
another path, but some more-structured else (json, csv, configparser, ...).

Maintainers could silently start adding the path=str(path) prolog to the
API so declaring official support for Path can be postponed until it is
certified that there's 100% coverage in stdlib.

Cheers,

-- 
Juancarlo *Añez*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141007/352a344c/attachment.html>


More information about the Python-ideas mailing list