Greg Ewing <greg.ewing at 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
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