[Python-projects] pylint doesn't like numpy
Adrien Di Mascio
Adrien.DiMascio at logilab.fr
Fri Dec 1 08:38:21 CET 2006
Hi,
[skip at pobox.com]
> Given this one-line script:
>
> from numpy import array, identity, matrixmultiply, dot
>
> pylint reports:
>
> pylintnumpy.py:1: [E] No name 'array' in module 'numpy'
> pylintnumpy.py:1: [E] No name 'identity' in module 'numpy'
> pylintnumpy.py:1: [E] No name 'matrixmultiply' in module 'numpy'
> pylintnumpy.py:1: [E] No name 'dot' in module 'numpy'
> pylintnumpy.py:1: [W] Unused import matrixmultiply
> pylintnumpy.py:1: [W] Unused import identity
> pylintnumpy.py:1: [W] Unused import array
> pylintnumpy.py:1: [W] Unused import dot
>
> No big deal on the warnings, but the errors perplex me because:
>
> % python
> Python 2.4.2 (#1, Feb 23 2006, 12:48:31)
> [GCC 3.4.1] on sunos5
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from numpy import array, identity, matrixmultiply, dot
> >>> import numpy
> >>> numpy.__file__
> '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/numpy/__init__.pyc'
>
> Why does pylint seem to think numpy doesn't provide those symbols?
I can't reproduce the problem here. Here's what I get :
pylintnumpy.py:1: [E] No name 'matrixmultiply' in module 'numpy'
pylintnumpy.py:1: [W] Unused import matrixmultiply
pylintnumpy.py:1: [W] Unused import identity
pylintnumpy.py:1: [W] Unused import array
pylintnumpy.py:1: [W] Unused import dot
The only error I have is because matrixmultiply does indeed not exist
in numpy (at least in version 1.0 where it was replaced by `dot`).
I'm using the development version of pylint, but the last changes made
to pylint since the last release (0.12.2) are unrelated to your problem.
(check http://www.logilab.org/cgi-bin/hgwebdir.cgi/pylint for more
details)
pylint version: dev
logilab-astng version: dev (0.16.2)
logilab-common version: dev (0.21.0)
numpy version: 1.0
python version: 2.4.4
Are you using the last pylint/astng versions ?
Cheers,
--
Adrien Di Mascio LOGILAB, Paris (France).
Formations Python,Zope,Debian,Calcul http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
Informatique scientifique: http://www.logilab.fr/science
Python in Python: http://codespeak.net/pypy/dist/pypy/doc/index.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20061201/6ecedb73/attachment.pgp
More information about the Python-Projects
mailing list