Nick Coghlan wrote: > So I suggest splitting the internal data into 'path elements separated > by os.sep', 'name elements separated by os.extsep' What bothers me about that is that in many systems there isn't any formal notion of an "extension", just a convention used by some applications. Just because I have a "." in my filename doesn't necessarily mean I intend what follows to be treated as an extension. > assert pth.basepath == HOMEDIR > assert pth.dirparts == ('foo', 'bar') > assert pth.nameparts == ('baz', 'tar', 'gz') What if one of the dirparts contains a character happening to match os.extsep? When you do pth2 = pth[:-1], does it suddenly get split up into multiple nameparts, even though it's actually naming a directory rather than a file? (This is not hypothetical -- it's a common convention in some unix systems to use names like "spam.d" for directories of configuration files.) -- Greg
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