from
Sylvain Thénault <sylvain.thenault at logilab dot fr>
subject
Re: [Python-projects] False warnings from 0.7.0 to 0.8.0
date
On Saturday 22 October à 15:39, logilab.abcx@spamgourmet.com wrote:2005/11/07 16:48
> Updating pylint from 0.7.0 to 0.8.0 generates a lot of false warnings.
please use pylint 0.8.1 and astng 0.13.1 to get the following
corrections:
> Generator expressions
> =====================
>
> # E0601 - Using variable 's' before assignment
> major, minor = (int(s) for s in value.split("."))
>
> # E0601 - Using variable 'validType' before assignment
> typeList = ", ".join(validType.__name__ for validType in validTypes)
fixed
> Packages split in multiple directories (using __path__)
> =======================================================
>
> I also get now a lot of E0611 warnings for "special" modules.
> I have a few packages which don't have all their modules inside the
> same folder. I modify the __path__ variable of the parent package so
> that Python can find them. Unfortunatly pylint doesn't take this into
> account right now. See http://www.python.org/doc/essays/packages.html
hum, I'm pretty sure older version of pylint (at least >= 0.6) didn't
handle this neither. Can't you handle this differently by using a .pth
file ?
> pylint doesn't recognize the __path__ package magic
> ===================================================
> # package/__init__.py
> # E0602 - Undefined variable '__path__'
> __path__ += "folder"
>
> # test.py
> import package
fixed
> Other package false errors
> ==========================
>
> # AudioTime/__init__.py
> class AudioTime(object):
> DECIMAL = 3
>
> # AudioTime/AudioTime.py
> class AudioTime(object):
> pass
>
> # AudioTime/AudioTimeDecimal.py
> from AudioTime.AudioTime import AudioTime
> class AudioTimeDecimal(AudioTime):
> pass
>
> # test.py
> from AudioTime import AudioTime
> # E0611 - No name 'DECIMAL' in module 'AudioTime.AudioTime'
> print AudioTime.DECIMAL
>
> As you can see, the AudioTime class from AudioTime/__init__.py should
> be given precedence over the AudioTime/AudioTime.py module just as
> Python does.
fixed
> Troubles with variables defined in parent class
> ===============================================
>
> class Base(object):
>
> def __init__(self):
> self._var = False
>
> class Derived(Base):
>
> def Work(self):
> # E0203 - Access to member '_var' before its definition line 13
> if self._var:
> print "True"
> else:
> print "False"
> self._var = True
>
> x = Derived()
> x.Work()
fixed
:)
--
Sylvain Thénault LOGILAB, Paris (France).
http://www.logilab.com http://www.logilab.fr http://www.logilab.org
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects
