[Numpy-discussion] PyChecker

Alexandre Fayolle alexandre.fayolle at logilab.fr
Wed Mar 21 04:07:05 EDT 2007


On Tue, Mar 20, 2007 at 08:48:46PM -0600, Charles R Harris wrote:
> On 3/20/07, Pierre GM <pgmdevlist at gmail.com> wrote:
> >
> >On Tuesday 20 March 2007 15:29:01 Charles R Harris wrote:
> >> but I want
> >> to suggest that we run pychecker, and maybe pylint, over the python code
> >to
> >> look for errors.
> >
> >I'm using Pydev w/ Eclipse that supports pylint. I usually don't have any
> >warning from pylint about numpy. Could you be more specific ?
> >___
> 
> 
> For instance, make a file warn.py containing the line:
> 
> from numpy import *
> 
<snip> 
> 
> Neither is an error, but it is bad style to shadow builtins and unexpected
> errors can result. The second warning refers to this bit of code:

If you go that way, it is bad style to import * in production code,
precisely because it can lead to identifier shadowing. You should try
import numpy as n

Remember the zen of Python:

Namespaces are one honking great idea -- let's do more of those!

-- 
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
Reprise et maintenance de sites CPS:     http://www.migration-cms.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070321/4ef30f8c/attachment.sig>


More information about the NumPy-Discussion mailing list