pylint, was Re: pygame - importing GL - very bad...
d at davea.name
Wed Jan 2 15:26:32 CET 2013
On 01/02/2013 09:09 AM, someone wrote:
> On 01/02/2013 01:07 PM, Peter Otten wrote:
>> someone wrote:
>>> On 01/01/2013 01:56 PM, Peter Otten wrote:
>>>> from module import * # pylint: disable=W0622
>>> Oh, I just learned something new now... How come I cannot type
>>> enable=W0622" in the line just below the import ?
>> With what intended effect?
> If I have a section with A LOT OF warnings and I don't want those in
> that section to show up ? Isn't that valid enough?
>>> Another thing is that I don't understand this warning:
>>> Invalid name "original_format" (should match (([A-Z_][A-Z0-9_]*)|
>>> > (__.*__))$)
>>> I get it everywhere... I don't understand how it wants me to label my
>>> variables... Maybe I should disable this warning to get rid of it...
>> pylint wants global names to be uppercase (what PEP 8 recommends for
>> constants) or "special" (two leading and two trailing underscores):
>> THATS_OK = 42
>> __thats_ok_too__ = object()
>> but_thats_not = "spam"
> OMG... I don't want to type those underscores everywhere... Anyway,
> thank you very much for explaining the meaning of what it wants...
Global const values should be ALL_CAPS, so it's obvious that nobody
intends to modify them. It's the non-const global attributes that
expect to be underscored.
You shouldn't have to use those underscores very often. After all,
there is seldom a need for a non-const global value, right? Don't think
of it as a pylint problem, but as a hint from pylint that perhaps you
should use fewer globals.
More information about the Python-list