On Thu, 12 May 2016 at 14:04 Sjoerd Job Postmus <sjoerd...@sjoerdjob.com>
wrote:

>
>
> > On 12 May 2016, at 21:30, Ethan Furman <et...@stoneleaf.us> wrote:
> >
> > If you need bytes support for your paths, there's at least one [1] that
> has that support.
>
> So if I would need bytes support, I should submit a pull request to
> <arbitrary but awesome library> which replaces usage of the stdlib pathlib
> with another variant, upon which they will decline the pull request because
> it introduces another "useless" dependency.
>

No, what you should do is ask them to create the pathlib instance lazily
and only when duck typing shows they weren't given a compatible object.
Then you could pass in some bytes-based solution like Ethan's and not worry
about pathlib's refusal to work with bytes. Or you simply ask them to work
with os.path after calling os.fspath() and be very careful to not use any
strings with the functions.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to