[Python-ideas] 'from os.path import FILE, DIR' or internal structure of filenames
Cameron Simpson
cs at zip.com.au
Mon Apr 21 02:41:16 CEST 2014
On this same topic...
On 21Apr2014 09:12, Cameron Simpson <cs at zip.com.au> wrote:
>On 20Apr2014 14:41, anatoly techtonik <techtonik at gmail.com> wrote:
>>>-1 because I can imagine wanting different nuances on the definitions
>>> above; in particular for DIR I can well imagine wanting bare
>>> dirname(abspath(FILE)) - semanticly different to your construction.
>>> There's lots of scope for bikeshedding here.
>>
>>Assuming that FILE is always absolute, how that:
>> dirname(abspath(FILE))
>>is different from that:
>> abspath(dirname(FILE))
>>?
>
>Depends what "absolute" means. When the source file was obtained by
>traversing a symlink, is FILE naive (ignored the symlink, just has to
>start at "/") or
>resolved (absolute path to FILE which does not traverse a symlink)?
>
>I can imagine use cases for both, and therefore the bikeshedding.
For what it's worth, I am on the naive side of this argument. If we got to a
file via a symlink or the like, then that is the filename "space" in which the
app is expecting to run, and therefore we shouldn't muck with those
expectations.
Cheers,
Cameron Simpson <cs at zip.com.au>
The supply chain is a network of atoms.
- overhead by WIRED at the Intelligent Printing conference Oct2006
More information about the Python-ideas
mailing list