Jack Jansen wrote: > One problem I see is that what you'd really like is to overload + and > split and such on path objects. Yup. Although it's unclear to me what would be the best behavior for +, because it could mean several things: 1) p = Path(a_directory) + filename # os.path.join(a_directory, filename) 2) p = Path(a_file) + ".ext" # a_file + ".ext" 1) is very useful, but then 2) wouldn't work... So it's not all straightforward. > But this creates a problem if you then > pass this path object to something that expects old-fashioned strings: > if it wants to manipulate that path it will use string operations, > which suddenly have different semantics... Yes, that's important to consider, too. On the other hand: the os.path.* functions could be made aware of the path object, similar to string.py, except it should fall back to the existing code when a string gets passed. Just
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