[Python-ideas] gofmt for Python: standardized styling as a language feature
Terry Reedy
tjreedy at udel.edu
Thu Mar 19 00:21:23 CET 2015
On 3/17/2015 9:54 PM, Nicholas Chammas wrote:
> I am not proposing putting |autopep8| in the standard library.
You gave that as an example and I went with it the absence of there
being anything else concrete, even a name. Substitute a mythical
'autostyle' if you wish.
> I am
> proposing that an auto-styler be included with Python as a first-class
> utility. The emphasis here is on /included/ and /first-class/.
We are wary about including anything more with the CPython distribution.
It is already too large to be managed by the core developer group as
well as we would like.
I disagree than not being included in 'cpython' necessarily makes
something less than first-class, as you seemed to say in another response.
> That auto-styler may well be based somehow on |autopep8|, but that is a
> separate discussion about /implementation/. I am first checking that the
> /idea/ is sound. I can’t tell if you had any objections to that idea.
I do. We should be careful about adding anything. When we do, we
should add libraries, not applications. We should especially not
officially endorse one of many opinion-based competitors.
Pip is the intended way to include 3rd party modules, as one chooses, as
virtual members of the stdlib or distribution.
FWIW, CPython already comes with a minimal autostyle script,
Tools/Scripts/reindent.py, which is used to enforce minimal requirements
for committing new or altered stdlib .py files to the cpython hg repository.
> couldn’t |autopep8| somehow be adapted to be an included module
> that can be invoked via |python -m|
Today it is invoked with 'autopep8'. Why would you want to have to add
'python -m'? For Idle, I would like to move in the other direction and
allow Idle to be started on a command line with 'idle' rather than
'python -m idlelib'. (This is possible today, but only if one adds
'.../python/lib/idlelib' to PATH, or, on windows, moves an edited
version of idle.bat to /Scripts.)
--
Terry Jan Reedy
More information about the Python-ideas
mailing list