PyCharm's strict PEP and not so strict?

Thomas Passin list1 at tompassin.net
Thu Apr 20 09:04:36 EDT 2023


On 4/19/2023 7:19 PM, dn via Python-list wrote:
> 
>> *PyCharm enables a range of Python-linters. Some by add-in. Some by
>> "External tools"*
>>
>> I was not 'up' on "linters", Thanks for the heads up! Attempted 
>> finding a "linter" on jetbrains... I take it that finding a 'linter' 
>> for Build #PC-222.4554.11, built on March 15, 2023
>> Is a matter of hit and miss... Any suggestions?
> 
> Try a web-search for "Python linters". Linters, I've know a few... (hum 
> along with the music...) have long been a part of the Python eco-system. 
> They have usually been designed to run from Python or 'the 
> command-line'. Accordingly, many can be added into PyCharm from 'the 
> outside'.
> 
> The original purpose was possibly to guide/nudge coders into the 
> practices recommended by PEP-008 (https://peps.python.org/pep-0008/). 
> This, as you will read, is not about syntax, but more about coding "style".
> 
> There are many to choose from. Some are more strict than others. 
> Recommendation: (for the good of your blood-pressure) stay away from 
> "highly opinionated" alternatives, such as Black. Try the ones which 
> offer options to turn-on/-off particular situations (as described earlier).

Be aware that most of these tools can be configured to be more or less 
fussy, but it's not going to be so easy for the uninitiated. 
Unconfigured, you will likely see a stream of messages that aren't 
helpful but may seem overwhelming. Once you have finally gotten one 
configured to your satisfaction, you probably will not need to change 
the configuration again for a long time.

You can generally disable specific warnings at a point in the code with 
special comments.  Using pylint, for example, perhaps appropriate in 
view of the OP's original post:

# pylint: disable = consider-using-f-string



More information about the Python-list mailing list