[Python-Dev] pathlib - current status of discussions

Brett Cannon brett at python.org
Wed Apr 13 15:54:44 EDT 2016


On Wed, 13 Apr 2016 at 12:39 Fred Drake <fred at fdrake.net> wrote:

> On Wed, Apr 13, 2016 at 3:24 PM, Chris Angelico <rosuav at gmail.com> wrote:
> > Is that the intention, or should the exception catching be narrower? I
> > know it's clunky to write it in Python, but AIUI it's less so in C:
> >
> > try:
> >     callme = path.__fspath__
> > except AttributeError:
> >     pass
> > else:
> >     path = callme()
>
> +1 for this variant; I really don't like masking errors inside the
> __fspath__ implementation.
>

Don't read too much into the code in that gist. I just did them quickly to
get the point across of the proposals in terms of str/bytes, not what will
be proposed in any final patch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160413/7aaf7ce6/attachment.html>


More information about the Python-Dev mailing list