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

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 21 12:10:38 CEST 2010


Paul Moore wrote:
> the natural reaction for any but the most careful
> of programmers would be to say something like hasextension(fn, '.txt')
> without thinking.

That's why I think that case-insensitivity should be the default.
Most of the time, people don't use case alone to distinguish between
different file types. It's only in rare situations such as .c vs
.C that the case matters, and in those situations, you know
that you're dealing with something special.

In any case, I don't believe it has anything to do with the
*filesystem* on which the file happens to reside. As long as
the filesystem is case-preserving, an application can regard
file extensions as being case-sensitive or not as it pleases.

-- 
Greg



More information about the Python-ideas mailing list