Le mercredi 13 avril 2016, Brett Cannon <<a href="mailto:brett@python.org">brett@python.org</a>> a écrit :<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><span style="line-height:1.5">All of this is demonstrated in </span><a href="https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1" target="_blank">https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1</a> by the various possibilities. In the end it's not a corner case because the definition of __fspath__ will be such that there's no ambiguity in what os.fspath() will accept and what __fspath__ can return and the code will be written to conform to what the PEP dictates (IOW I'm aware that this needs to be considered in the implementation :) .</div></div></div></blockquote><div><br></div><div>I'm not a big fan of a flag parameter to change the return type of a function. Usually, two functions are preferred. In the os module we have getcwd/getcwdb for example. I don't know if it's a good example</div><div><br></div><div>Do you know other examples of Python functions taking a (flag) parameter to change the result type?</div><div><br></div><div>Victor</div>