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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com