I've just upgraded to pylint 1.7.1. This is an excellent upgrade, with many 
new warnings, some of which I've even chosen to enable :-)

In particular, I've just exterminated many ancient c-isms that test the 
length of strings or arrays rather than test s.

In no way are any of these changes guaranteed to be safe.  In particular, 
changing:

if len(s) ==0:
  << a >>
else:
  << b >>

requires, on stylistic grounds, that the new test be:

if s:
  << b >>
else:
  << a >>

This happens in several places. The result is significantly clearer code.

And there is an assignment:

    ignore = len(s) > 0

which turns into:

    ignore = bool(s)

I have carefully checked the diffs and repeatedly run all unit tests.  The 
new code is likely unchanged in effect. Imo, removing the c-isms is worth 
the slight risk entailed.

All of Leo's core files (including gui plugins) now pass the additional 
pylint tests.  Tomorrow I'll remove pylint complaints in all other plugins.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to