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

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 22 01:09:53 CEST 2010


Mike Meyer wrote:

> I'm talking about the case where the developer knows he wants
> case sensitivity. In that case, you have to know whether or not the
> file system is case sensitive to know whether or not "file.c" would
> get opened if the application tried to open "file.C".

What? I thought the use case we were talking about is
where you have a filename and you want to make a guess
about what kind of data it contains, based on the
extension.

I don't think I've ever wanted to find out whether a
file will get opened if I use the wrong case. I just
trust that the filename I'm given is suitable for
passing to open(), whatever case it might have. I
also can't think why you might be worried about that
just for the extension, and not the rest of the
pathname.

-- 
Greg




More information about the Python-ideas mailing list