Greg Ewing <greg.ew...@canterbury.ac.nz> writes:

> Maybe we could use a heuristic such as:

Your heuristics seem to assume there will only ever be a maximum of one
match, which is false. I present the following example:

    $ ls foo/
        bAr.dat  BaR.dat  bar.DAT

> 1) Search the directory for an exact match to the name given,
> return it if found.

And what if there are also matches for a case-insensitive search? e.g.
searching for ‘foo/bar.DAT’ in the above example.

> 2) Look for a match ignoring case. If one is found, test it to
> see if it refers to the same file as the given path, and if so
> return it.

And what if several matches are found? e.g. searching for ‘foo/BAR.DAT’
in the above example.

> 3) Otherwise, raise an exception.

It seems to me this whole thing should be hashed out on ‘python-ideas’.

-- 
 \           “In case you haven't noticed, [the USA] are now almost as |
  `\     feared and hated all over the world as the Nazis were.” —Kurt |
_o__)                                                   Vonnegut, 2004 |
Ben Finney

_______________________________________________
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

Reply via email to