On 04/13/2016 02:37 PM, Victor Stinner wrote: > 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 I think of os.fspath() as more of a filter/reduce operation: - str -> str - str DirEntry -> str - bytes -> bytes - bytes DirEntry -> bytes The purpose of os.fspath() (at least the one I'm arguing for ;) is to distil its inputs to the lowest common denominator, and no lower -- which is either str for string-based path objects, or bytes for bytes-based path objects. -- ~Ethan~
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4