[Python-ideas] Small enhancement to os.path.splitext

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 23 02:53:16 CEST 2010


Mike Meyer wrote:

> Given that the argument for making the test case-insensitive to start
> with was that the user expects .JPG and .jpg to be the same, I think
> you just shot down the case for making the test case-insensitive as
> well.

I only said it should be case-sensitive as a *default*.
The .c/.C thing is a special case, which the application
can deal with by explicitly requesting a case-sensitive
comparison. Most of the time you'll be dealing with
things like .jpg/.JPG, where I don't think any harm could
be caused by treating the extensions case-insensitively
always.

I still don't think you can decide based on the file
system behaviour. What if the user creates his files on
a case-insensitive system and then copies them to a
case-sensitive one or vice versa? The intended meaning
of the extensions doesn't suddenly change when that
happens.

-- 
Greg



More information about the Python-ideas mailing list