osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] PEP 572: A backward step in readability


The PEP s section on Frequently raised objections includes:

(https://www.python.org/dev/peps/pep-0572/#this-could-be-used-to-create-ugly-code)

> This could be used to create ugly code!
>
> So can anything else. This is a tool, and it is up to the programmer to use it where
> it makes sense, and not use it where superior constructs can be used.

The above is so dismissive of a very real problem.

* Python makes syntax decisions to make it easier to read.
* One of the first, and enduring ones was "No  assignment within expressions".
* I had both seen, and debugged problems in the C-language caused by assignment
  expressions; and was glad to be rid of them in Python.

Assignment within expressions was, I think,  difficult to *teach* in
C. And will become
something error-prone to *learn* in Python.

The Python community has grown over the decades, and we have attracted community
members who want to help  and are motivated, but Python is not a
tick-list of features.

A PEP that can detract from readability; *readability*, a central
tenet of Python, should
be rejected, (on principle!), when such objections are treated so dismissively.