[Python-projects] pylint global warnings

Alexandre Fayolle alexandre.fayolle at logilab.fr
Tue Apr 15 10:03:28 CEST 2008


On Tue, Apr 15, 2008 at 09:00:25AM +0200, Sylvain Thénault wrote:
> 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? 

Or use optparse, which will store the values as attributes in an option
container. 

-- 
Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20080415/11b23796/attachment.pgp 


More information about the Python-Projects mailing list