pylint -- should I just ignore it sometimes?

Jean-Michel Pichavant jeanmichel at sequans.com
Fri Oct 22 12:43:11 EDT 2010


> I'm all for descriptive names, but there's a great deal of benefit to
> knowing when a descriptive name will help, and when all you need is a
> variable which will be quickly recognized.
>
> Compare:
> [theValueInTheList.func() forTheValueInTheList in theList]
> [x.func() for x in list]
>
> One of these is much, much, easier to read than the other.  It's
> not the one that used a "descriptive" name.
>
> -s
>   

You did not use descriptive names in your example, but verbose names. 
That makes a huge difference.

[ str(day) for day in week ]
[ str(x) for x in _list]
[ str(d) for d in w ]

I let you decide which one is better. After that I'm running out of 
arguments :o)

Note that I did not suggest to write
[ aDayInAWeek.displaymeCauseImAwesome() for aDayInAWeek in 
weekContainingSomeDaysHopefully ]

Cheers,

JM



More information about the Python-list mailing list