pylint scores

wheres pythonmonks wherespythonmonks at gmail.com
Fri Jul 30 09:12:51 EDT 2010


I am starting to use pylint to look at my code and I see that it gives a rating.
What values do experienced python programmers get on code not
targeting the benchmark?

I wrote some code, tried to keep it under 80 characters per line,
reasonable variable names, and I got:

0.12 / 10.

Is this a good score for one not targeting the benchmark?  (pylint
running in default mode)

Somewhat related:  Is the backslash the only way to extend arguments
to statements over multiple lines?  (e.g.)

>>> def f(x,y,z): return(x+y+z);
...
>>> f(1,2,
... 3)
6
>>> assert f(1,2,3)>0,
  File "<stdin>", line 1
    assert f(1,2,3)>0,
                     ^
SyntaxError: invalid syntax
>>>

In the above, I could split the arguments to f (I guess b/c of the
parens) but not for assert.  I could use a backslash, but I find this
ugly -- it that my only (best?) option?

[I really like to assert my code to correctness and I like using the
second argument to assert, but this resulted in a lot of long lines
that I was unable to break except with an ugly backslash.]

W



More information about the Python-list mailing list