[Python-projects] pylint global warnings

Sylvain Thénault sylvain.thenault at logilab.fr
Tue Apr 15 09:00:25 CEST 2008


On Tue, Apr 15, 2008 at 11:48:47AM +0800, Daniel(原志) wrote:
> Hi, Sylvain,

Hi,

first please use the python-projects at logilab.org mailing-list for pylint
related discussion (Cc'ed).

> I'm trying to use pylint.  But I found it is difficult to remove all
> warnings.

you usually don't have to expect 0 warnings when pylint is running on
your program. It may flag a lot of things which are not problems.
 
> I have a program need to parsing many command line options.
> eg.
> my_test.py -a -b -c -d -e -f -h -i -j -k -l -m -n -o -p -q foo.file
> 
> I need some global variable to assign some flag.
> If I put all these variable into a main(), the pylint warning me it contain
> too many variable in local function.
> If I put in global, pylint warning me discourage modify global variable in
> function.
> 
> I have no idea how to do it.  Could you give me some hint?

put your flags into a dictionary? 

-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science



More information about the Python-Projects mailing list