Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Pycharm IDE for Python, unused variables

Tags:

pycharm

It used to be the case that when I did not use a variable in Pycharm, the IDE editor would make the variable appear gray. That feature is gone now and I cannot get it back. Does anyone know how to get this feature back?

like image 250
user147178 Avatar asked Apr 19 '16 16:04

user147178


2 Answers

In the Settings open Editor -> Inspections. In the list in the middle open the python category and look for "Unused local" (it is sorted alphabetically). That should be checked.

Also check your color settings in case the variable simply doesn't get highlighted the way you want it.

like image 134
TehSphinX Avatar answered Sep 22 '22 04:09

TehSphinX


As @TehSphinX mentioned, the Editor -> Inspections settings is where it is. Use the search bar.

Also, perhaps as important: don't forget the "reader mode" in that mode pycharm does not analyze your code even if the preference settings are right.

like image 43
Charlie Parker Avatar answered Sep 20 '22 04:09

Charlie Parker