Let's just say up front that I'm a strong -1 on this proposal, as I
think it is needless churn, and while it may be *technically* backward
compatible, in reality it will be immensely disruptive.

There's one particular point I want to pick up on, though.

On Thu, 11 Nov 2021 at 15:25, Matt del Valle <matthew...@gmail.com> wrote:

> If we went to a disconnected alternate universe where python had never been 
> invented and introduced it today, in 2021, would we introduce it with a 
> uniform naming convention, or the historical backwards-supporting mishmash of 
> casing we've ended up with? Since I think the answer is pretty clear, I'm 
> strongly in favor of making this minimally-invasive change that at least 
> works towards uniform casing, even if that dizzying utopia is far beyond the 
> horizon. Our grandchildren might thank us :p

Certainly, there's a lot of inconsistency that can only be justified
as historical baggage. There have been a number of proposals to "tidy
up" such cases, but even when focused on specific instances, the
general conclusion has been that this would be too disruptive. But
let's put that aside and address the broader question here.

Yes, if we'd been designing everything now, we quite probably would
have adopted a more consistent approach. But I think it's foolish to
assume that whatever convention we defined for names would be strictly
based on the type of the value. After all, even if you adopt a
no-compromises stance on PEP 8 (a stance that the PEP itself rejects,
by the way!) the first part of the "Naming Conventions" section says

"""
Names that are visible to the user as public parts of the API should
follow conventions that reflect usage rather than implementation.
"""

To examine some specific cases, lists are a type, but list(...) is a
function for constructing lists. The function-style usage is far more
common than the use of list as a type name (possibly depending on how
much of a static typing advocate you are...). So "list" should be
lower case by that logic, and therefore according to PEP 8. And str()
is a function for getting the string representation of an object as
well as being a type - so should it be "str" or "Str"? That's at best
a judgement call (usage is probably more evenly divided in this case),
but PEP 8 supports both choices. Or to put it another way, "uniform"
casing is a myth, if you read PEP 8 properly.

What you actually seem to be arguing for is a renaming based on a
hypothetical version of PEP 8 that is far stricter than the actual
document, and which doesn't take into account the messiness of
real-world APIs and applications. That's a very common, and in my
opinion misguided, stance. For me, one of the best things about PEP 8
is its repeated assertions that the "rules" it defines are only
guidelines and that they should not be imposed blindly, but programmer
judgement should always take precedence. I find it very frustrating
that people making a fuss about "following PEP 8" seem completely
blind to the whole of the section "A Foolish Consistency is the
Hobgoblin of Little Minds" (one part of which explicitly says that the
PEP does not justify adding or changing code just to follow guidelines
that were created after the code was written), and the *many* places
where the PEP offers two (or sometimes even more) alternatives,
without preferring one over the other.

As I said, I'm -1 on this proposal.

Paul

PS If you are really committed to an alternative naming convention,
you can always write a module that adds all of the aliases you might
want. That way, you can follow your own preferences without imposing
them on everyone else...
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/D56P72COERVXLYWADMM76JYI4EFSC27T/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to