pylint -- should I just ignore it sometimes?

Neil Cerutti neilc at norwich.edu
Thu Oct 21 08:49:47 EDT 2010


On 2010-10-21, Jean-Michel Pichavant <jeanmichel at sequans.com> wrote:
> In the middle of thousand lines of code, when you are reviewing
> or debugging, the later is better TMO, the point is that x, y,
> z = is only easy to read during the assignement. Consider this:
>
> x, y, z = p.nextpoint()
> [snip a dozen of code line]
> ...
> ...
> ...
> ...
> ...
> ...
> ...
> ...
> y += 1 # hmmm ??
>
> vs
>
> xCoordinate, yCoordinate, zCoordinate = polygon.nextPointCoordinates()
> [snip a dozen of code line]
> ...
> ...
> ...
> ...
> ...
> ...
> ...
> ...
> yCoordinate += 1

_The Practice of Programming_ has this right. In general the
bigger the scope of a variable, the longer and more descriptive
should be its name. In a small scope, a big name is mostly noise.

-- 
Neil Cerutti



More information about the Python-list mailing list