Message220342
This doesn't seem to be the case for Python 3.4. Also, _ast.arguments didn't have "lineno" and "col_offset" attributes neither in Python 2. But the _arg.arg nodes have those attributes, as seen in this example.
>>> from ast import parse
>>> parse("""
... def test(a): pass
... """)
<_ast.Module object at 0x02E43330>
>>> f=_
>>> f.body[0].args
<_ast.arguments object at 0x02E43390>
>>> f.body[0].args.lineno
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'arguments' object has no attribute 'lineno'
>>> f.body[0].args.args
[<_ast.arg object at 0x02E43270>]
>>> f.body[0].args.args[0].lineno
2
>>> |
|
Date |
User |
Action |
Args |
2014-06-12 12:08:52 | Claudiu.Popa | set | recipients:
+ Claudiu.Popa, ncoghlan, benjamin.peterson, emile.anclin |
2014-06-12 12:08:52 | Claudiu.Popa | set | messageid: <1402574932.9.0.727964380453.issue10445@psf.upfronthosting.co.za> |
2014-06-12 12:08:52 | Claudiu.Popa | link | issue10445 messages |
2014-06-12 12:08:52 | Claudiu.Popa | create | |
|