Le mercredi 13 avril 2016, Brett Cannon <br...@python.org> a écrit : > > All of this is demonstrated in > https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1 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 :) . >
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 Do you know other examples of Python functions taking a (flag) parameter to change the result type? Victor
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com