[pylint] why pylint wants only capitals identifiers?

Giacomo Boffi giacomo.boffi at polimi.it
Mon Apr 19 11:32:31 EDT 2010


Jean-Michel Pichavant <jeanmichel at sequans.com> writes:

> Giacomo Boffi wrote:
>> i have this code
>>
>> def example(a):
>>     return lambda b: a+b+1
>>
>> fun = example(10)
>> k_1 = fun(7)
>> ...
>>
>> and pylint tells me
>>
>> [...]
>> C:  4: Invalid name "fun" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
>> C:  5: Invalid name "k_1" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
>> [...]
>>                                                                 g
>>
> Pylint default rules need some tuning

ok, but maybe it's not my specific problem (see below)

> However, given you example, you should not insert code execution at
> you module level, unless it's required only at the module import. I
> dont know what is your module

module? this was not well specified in my OP, but i'd rather speak of
a "script" instead of a module...

maybe should i use the

if __name__ == "__main__":
    main()

idiom to keep happy my pylint? oh, let's do it... it should be easy
isn't it?

thanks,
                                                                g
-- 
 I wish we'd come to our senses and see there is no truth
 In those who promote the confusion for this ever changing mood.
(people get ready people get ready people get ready people get ready)



More information about the Python-list mailing list