[Python-ideas] Small enhancement to os.path.splitext
Fred Drake
fdrake at acm.org
Wed Apr 21 02:27:23 CEST 2010
On Tue, Apr 20, 2010 at 8:18 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Seems to me the best thing to do is always compare extensions
> case-insensitively unless you have a specific reason to do
> otherwise. So I would recommend that any proposed hasextension()
> function should be case-insensitive by default.
I've certainly seen cases where the case was relevant in order to
determine how a file was handled. There have been compilers that
interpreted .c as C and .C as C++. (Not that better options weren't
available, but that was part of the default interpretation.) This was
GCC, so... not particularly obscure.
-Fred
--
Fred L. Drake, Jr. <fdrake at gmail.com>
"Chaos is the score upon which reality is written." --Henry Miller
More information about the Python-ideas
mailing list