Pylint bug in python35 b2

Peter Otten __peter__ at web.de
Thu Jul 2 16:07:05 CEST 2015


Florent Quesselaire wrote:

> i installed python35 b2
> and tested to pip install / easy install pylint plgin
> but i got an :
> 
> AttributeError : 'Call' object has no attribute "starargs".
> 
> i feel this error more python side than pylint side because it is the same
> version who works fine in 3.4.3

That looks like a change in the ast that breaks backwards compatibility 
rather than a bug:

$ python3.4
Python 3.4.0 (default, Jun 19 2015, 14:20:21) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> module = ast.parse("f(*x)")
>>> module.body[0].value
<_ast.Call object at 0x7f082ce07860>
>>> _.starargs
<_ast.Name object at 0x7f082cd8c240>
>>> _.id
'x'
>>> 
$ python3.5
Python 3.5.0b2+ (3.5:9aee273bf8b7+, Jun 25 2015, 09:25:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> module = ast.parse("f(*x)")
>>> call = module.body[0].value
>>> call.starargs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Call' object has no attribute 'starargs'
>>> call.args
[<_ast.Starred object at 0x7f6e633cb208>]
>>> call.args[0].value.id
'x'

pylint likely needs an update to support 3.5 anyway as there is some new 
syntax.



More information about the Python-list mailing list