Consider the motivation. Tal wrote:
“”"
At the time of this PEP’s writing, there are over 1,300 open pull
requests (“PRs”) on the CPython Github repository [2], and over 3,000
open bug tracker issues with a patch or a PR [5]. This large “backlog”
has been acknowledged as a serious problem, as can be seen, for example,
by the Python Steering Council discussing this in November 2019 [13].
“”"
Is that a large number for a project the size of CPython?
How does that compare to other projects of similar size?
As a very, very rough measure of issues per project complexity:
-
the black project has 326 open issues per megabyte;
-
numpy has 260 open issues per megabyte;
-
Pandas has 362 open issues per megabyte;
-
and CPython has 165 open issues plus PRs per megabyte.
(I took the number of open issues on the project’s Github repository,
and divided by the size of the downloaded zip file as a rough measure of
complexity. For CPython, I used the number of open issues plus the
number of PRs. There is probably some significant double-counting by
doing so.)
Julia has 3119 open issues; Ruby has 1711; Perl has 1935; D has 4511.
I am not seeing evidence that CPython is doing worse at managing open
issues than other projects.
Tal continued:
“”"
The most significant reason for this is a lack of core developer time to
review and handle these patches and PRs, as noted in the Python
Developer’s Guide [6] and many times on the python-dev mailing list [7]
and discuss.python.org [8].
“”"
Is code formatting the bottleneck here? You talk about lack of developer
time, but are they spending unreasonable amounts of time reviewing the
code formatting of PRs?
If not, then this motivation is spurious.
If code formatting is not a bottleneck for reviewing PRs, then how will
automatic formatting help lower the number of PRs that need to be
reviewed, or speed up the rate that PRs are dealt with?
If this gets accepted, what metric do you propose we use to decide
whether the move to automatic code formatting was helpful or not?
Tal again:
“”"
Besides making the PR process more efficient, adopting auto-formatting
would “lower the bar” for new contributors. The current workflow
requires contributors to read PEP 7, PEP 8 and the documentation style
guide [14], and to understand the subtleties of when to apply them or
conform to the style of existing code.
“”"
Nothing prevents us from suggesting that new contributors might choose
to use a code formatter like black or autoPEP8. We could add that to the
Dev-Guide right now, possibly without even a PEP, link to the two or
three most popular code formatters. None of that requires it to be
mandatory.
“”"
Finally, constantly thinking about code style is a distraction from
more significant aspects of code, such as correctness and readability.
“”"
That’s an odd thing to say. I almost never think about code style, but
when I do, it is always because I am concerned about readability.
Mindlessly formatting code is certainly ripe for automation, but it’s
also something that many developers do unconsciously. I don’t think
about formatting the 90 or 95% of easy cases, it just happens without
much or any conscious thought (especially if my editor has good
auto-indent).
But it’s the remaining 5 or 10% of cases where I don’t want to have to
fight the auto-formatter precisely because I care about the readability.