A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-May/064908.html below:

[Python-Dev] Alternative path suggestion

[Python-Dev] Alternative path suggestion [Python-Dev] Alternative path suggestionGreg Ewing greg.ewing at canterbury.ac.nz
Sat May 6 13:02:28 CEST 2006
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
More information about the Python-Dev mailing list

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