<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 19 April 2016 at 21:55, Stephen J. Turnbull <span dir="ltr"><<a href="mailto:stephen@xemacs.org" target="_blank">stephen@xemacs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I really want to know.  I'm not 100% sure that's the right way to go,<br>
mostly because Nick and Brett are signed up for polymorphism.  But I<br>
sure haven't seen any explicit arguments for polymorphism, though I've<br>
asked for them.  AFAICS, everybody just assumed that because some<br>
related APIs are polymorphic, this one should be, too, and dove into<br>
the problem of how to make a polymorphic API safe for Python 3.<br></blockquote><div><br></div></div>In my case, it's ~5 years of peripheral involvement in porting the Fedora ecosystem to Python 3. I haven't personally done that much of the actual porting work, but I've spent plenty of time talking to the folks that are, and tweaking various things to make their lives easier where I could make the case that there was either a benefit to Python 3, or at least no harm to it.<br><br></div><div class="gmail_extra">The gist of the motivation for bytes/str polymorphism here is similar to that for restoring __mod__ polymorphism in <a href="https://www.python.org/dev/peps/pep-0461/">https://www.python.org/dev/peps/pep-0461/</a>: the bytes/str duality is as much a fact of life when dealing with OS interfaces as it is when dealing with wire protocols, so if __fspath__ is polymorphic, then it's easier for compatibility modules like six and future to define their own "fspath" helper functions that work on both Python 2 and Python 3 across all supported platforms.<br><br></div><div class="gmail_extra">This is also why I ended up proposing pushing the complexity down into a documented-but-underscore-prefixed API: folks writing pure Python 3 application code *really* shouldn't need to worry about the bytes support in the protocol, but for operating system level use cases, not having it readily available to 2/3 compatible Python code would be a pain.<br><br></div><div class="gmail_extra">Cheers,<br></div><div class="gmail_extra">Nick.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>   |   Brisbane, Australia</div>
</div></div>