<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, 13 Apr 2016 at 12:25 Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Apr 14, 2016 at 3:10 AM, Brett Cannon <<a href="mailto:brett@python.org" target="_blank">brett@python.org</a>> wrote:<br>
> <a href="https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1" rel="noreferrer" target="_blank">https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1</a> has the<br>
> four potential approaches implemented (although it doesn't follow the<br>
> "separate functions" approach some are proposing and instead goes with the<br>
> allow_bytes approach I originally proposed).<br>
<br>
All of them have this construct:<br>
<br>
try:<br>
    path = path.__fspath__()<br>
except AttributeError:<br>
    pass<br>
<br>
Is that the intention, or should the exception catching be narrower? I<br>
know it's clunky to write it in Python, but AIUI it's less so in C:<br>
<br>
try:<br>
    callme = path.__fspath__<br>
except AttributeError:<br>
    pass<br>
else:<br>
    path = callme()<br></blockquote><div><br></div><div>I'm assuming the C code will do what you're suggesting. My way is just faster to write in 2 minutes of coding. :)</div></div></div>