Pylint: Upper_case naming style

Heeey,

I just finished the Mastery for SQL course, and continued with the python course. After the first lesson Mosh asks you to define a variable:

"
students_count = 1000
print(students_count)
"

The version of Pylint says there is a problem:
"Constant name “students_count” doesn’t conform to UPPER_CASE naming style Pylint(C0103:invalid-name)

Is there a way I won’t need to write variables in capital letters, can fix this warning or bypass this warning. It is really annoying, especially when code will be longer.

Personally in VSCode I prefer pylama for linting over pylint. You might like that better too.

To use a different linter - press keys ctrl-shift-P to open the command palete, then type Python: Select Linter, and then click that row that is found, and then choose a different linter (you may be asked to install it). Note that probably just typing Linter will also find the item when you are search in the command palette.

However, for the past year (since 2020 or 2021) I think that PyLance is the default python extension for VSCode and it is probably the best now as well. So I would even first consider uninstalling any other linters (Pylint, PyLama, Flake8) and just installing and using PyLance. Edit: Note that to be honest I don’t even know if I use linters in VSCode anymore – I just install PyLance and everything seems to work as expected so maybe it’s just detecting errors in a different way, without linting at all.

As far as that error goes, it is generally common in real-world professional scripts to put all code in classes and functions (although by all means not 100% of the time - ad hoc scripts are still useful and used a lot). So I think this linting rule is a bit too opinionated (I suppose that’s why I have never liked pylint generally).

You can add your thumbs up/down to a few posts since this issue was once brought up with the pylint devs, although they don’t seem inclined to change their minds.

1 Like

Thanks alot!
I installed pylance and removed pylint.
Now I can enjoy this with more fun! Soon to be a coder =) (i hope)