[Python-ideas] lint in stdlib

Terry Reedy tjreedy at udel.edu
Wed May 6 06:23:28 CEST 2009


Nick Coghlan wrote:
> Terry Reedy wrote:
>> Aahz wrote:
>>> On Mon, May 04, 2009, Chris Rebert wrote:
>>>>>>> On Mon, May 04, 2009, John Graham wrote:
>>>>>>>> Has anyone ever suggested a standard pylint, something that might be
>>>>>>>> distributed with the interpreter/libraries? ?As important as the
>>>> Wouldn't it be be better placed in the Tools/ directory rather than as
>>>> part of the stdlib?
>>> Perhaps, but I don't think so -- you need a source tree to get Tools/

My standard Windows 3.0.1 installation has Tools without the source 
tree.  It has 5 directories, including Scripts/, which has about 50 .py 
files, including 2to3. If *that* can go there, I see no reason why a 
syntax checker could not also.

>>> AFAIK, and if some form of lint gets blessed by incorporation into
>>> Python, then it needs to be available for all standard installs.
>> Regardless, the stdlib is for modules to import, tools for programs that
>>  run.
> 
> We blur that line all the time though (cf. timeit, pdb, pydoc,
> webbrowser, runpy, probably others).
> 
> So I'd agree with Aahz that if python-dev is going to bless something
> along these lines, it should be something worthy of inclusion in the
> standard lib itself rather than just being dropped into the Tools directory.

timit, pdb, webbrowser, amd runpy are importable modules that *also* 
have a command-line interface via "if __name__ == '__main__': ...". 
Pydoc might be also, but I could not be sure from the doc.  If the 
checker were written similarly, so that it could be imported and used 
from within a program to check another file, then I would agree that 
stdlib would be a place for it.

tjr




More information about the Python-ideas mailing list