How to make Python interpreter a little more strict?

Steven D'Aprano steve at pearwood.info
Sat Mar 26 08:00:09 EDT 2016


On Fri, 25 Mar 2016 11:06 pm, Aleksander Alekseev wrote:

> Is it possible to make python complain in this case? Or maybe solve
> such an issue somehow else?

This is a job for a "linter", such as pychecker, pylint or pyflakes. Google
for more if you are interested.

A linter will check your code for things which are *legal* code, but might
not do what you expect, or are a sign of a potential error. For instance,
dead code that will never be reached, or variables that are defined and
then never used, or functions (such as next) which are named but not used.

Another thing you can do is use an editor which colours functions
like "next" differently from statements like "continue".



-- 
Steven




More information about the Python-list mailing list