[Python-Dev] Proposal to revert r54204 (splitext change)

Phillip J. Eby pje at telecommunity.com
Tue Mar 20 19:52:05 CET 2007


At 05:07 PM 3/20/2007 +0100, Martin v. Löwis wrote:
>Ronald Oussoren schrieb:
> > What I don't understand is why 'ignore_leading_dot==False' is considered
> > to be a valid usecase at all, except for the fact that os.path.splitext
> > did this until py2.5. I'm definitely in the camp that considers
> > '.profile' not to have an extension.
>
>That is precisely the core of the discussion. It's not that
>ignore_leading_dots=False is considered useful, in the call (except
>for a few people that claim that splitext('.txt') ought to give
>'','.txt')

Actually, *this* is precisely the problem: arguing that the opinion of 
these "few people" is irrelevant, because a few *other* people think 
they're wrong to find that behavior useful.

I'm able to see that considering '.profile' to not have an extension is a 
*reasonable* position to take, and that doing it from the start *might* 
have been a good idea.

What I disagree with is punishing people who considered the opposite 
approach equally valid, and took the documentation and tests at their word.

Breaking their code without warning would be rude enough, but unfortunately 
it affects not only the person who directly uses splitext(), but everyone 
who uses any library, tool, or application that relies on the current behavior.

The very fact that you keep treating the current behavior as *not* useful 
is the very core of our disagreement.  Indeed, it seems to me quite 
disrespectful that you will not take anyone at their word that they do 
indeed expect, desire, and *value* the existing behavior, and wish to 
continue to have access to it in future versions of Python.

Suppose that the behavior had been the other way around to begin with, and 
Windows users started filing bugs about it, because it disagrees with 
Windows Explorer's interpretation of the extension?  Would you simply 
change the Unix-oriented behavior because it's clearly a "bug"?

If not, then what is your rationale for changing it the other way?  Make no 
mistake: both behaviors are desirable, for different reasons.  And both 
interpretations merely reflect platform-specific shell policies, so neither 
is any more "true" or "correct" in some absolute sense.  (If anything, 
Windows at least derives from an operating system that actually *has* 
extensions as part of its filesystem, whereas Unix does not.)

The people who would like to keep the old behavior have all, to my 
recollection, acknowledged that other behaviors are desirable.  Why won't 
the people who want to *change* the behavior acknowledge the same thing?



More information about the Python-Dev mailing list