Brett Cannon <brett <at> python.org> writes: > > :) I figured. I was close myself until I decided to be the "not inheriting from str is a sane decision" camp because people weren't understanding where the design decision probably came from, hence http://www.snarky.ca/why-pathlib-path-doesn-t-inherit-from-str That's a good write-up, thank you. Paths don't have to inherit str any more than IP addresses or any other thing that happens to be passed as a string in traditional APIs. On a concrete point, inheriting str would make the API a horrible, confusing, dangerous mess missing regular string semantics (concatenation with +, for example, or indexing) with path-specific semantics and various grey areas (should .split() have path semantics or str semantics? what is the rule and how are people supposed to remember it?). (of course, for PHP or Javascript programmers it may not sound like a problem. Let "adding" two IP addresses return the concatenation of their string representations...) Regards Antoine.
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