<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, 8 Apr 2016 at 08:33 Ethan Furman <<a href="mailto:ethan@stoneleaf.us">ethan@stoneleaf.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 04/08/2016 02:50 AM, Nick Coghlan wrote:<br>
<br>
>> Built-in? (name is dependent on #1 if we add one)<br>
><br>
> os.fspath (alongside os.fsencode and os.fsdecode)<br>
<br>
I like this better.<br>
<br>
<br>
>> Add the method/attribute to str? (I assume so, much like __index__() is on<br>
>> int, but I have not seen it explicitly stated so I would rather clarify it)<br>
><br>
> Makes sense<br>
<br>
What will this do? Return a Path or a str? I don't think we need either.<br></blockquote><div><br></div><div>When I brought this up it was to return self.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
>> Expand the C API to have something like PyObject_Path()?<br>
><br>
> PyUnicode_FromFSPath, perhaps? The return type is well-defined here,<br>
> so it can be done as an alternate constructor, and the C API<br>
> counterparts of os.fsdecode and os.fsencode are PyUnicode functions<br>
> (specifically PyUnicode_DecodeFSDefault and PyUnicode_EncodeFSDefault)<br>
<br>
So this will do the same thing as os.fspath() at the C level, yes?<br></blockquote><div><br></div><div>Yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
> It's worth summarising in a PEP at least for communications purposes -<br>
> very easy for folks that don't follow python-dev to miss otherwise.<br>
> Plus my specific API suggestions are pretty different from Ethan's :)<br>
<br>
*sigh* Okay<br></blockquote><div><br></div><div>Chris Angelico and I have been asked by Guido to work together to come up with a proposal after all the discussions are finished and it will most likely be a patch to the pathlib PEP.</div></div></div>