[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-11-22 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-11-22 Thread Ethan Smith
Ethan Smith added the comment: This has been fixed, so the issue can be closed I believe. FWIW I didn't see anything useful to salvage from my PR that wasn't already tested by your tests Serhiy. -- pull_requests: +9923 ___ Python tracker

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-11-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I forgot about this issue and independently made similar changes in issue34876. Please rebase your PR and determine whether it contains any useful changes in comparison with the current code (maybe new non-duplicated tests or useful refactoring?).

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-24 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-12 Thread Ethan Smith
Change by Ethan Smith : -- pull_requests: +6154 ___ Python tracker ___ ___

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-07 Thread Ethan Smith
Ethan Smith added the comment: In my PR, I added `def_lineno` and `class_lineno` as fields in the ASDL, instead of attributes (since constructors cannot have attributes, only types can). This means they show up in `ast.dump` which is probably not the desired behavior, as it

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-07 Thread Ethan Smith
Change by Ethan Smith : -- keywords: +patch pull_requests: +6115 stage: -> patch review ___ Python tracker ___

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-06 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > I was hoping to see if this was seen as a reasonable patch that might be > accepted. I didn't look carefully but superficially it looks reasonable, so it is worth trying. > Also, while I think it would be nice, I take it a patch for

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-05 Thread Ethan Smith
Ethan Smith added the comment: I have a branch with an implementation of my suggestion here: https://github.com/ethanhs/cpython/tree/decorlineno I was hoping to see if this was seen as a reasonable patch that might be accepted. Also, while I think it would be nice, I take

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-05 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-05 Thread Nitish
Change by Nitish : -- nosy: +nitishch ___ Python tracker ___ ___ Python-bugs-list

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-03 Thread Ethan Smith
Ethan Smith added the comment: There is also a relevant mypy bug report https://github.com/python/mypy/issues/3871. This seems like a common problem for tools working on the AST. The relevant code seems to be https://github.com/python/cpython/blob/master/Python/ast.c#L1695.

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See how similar issue was solved in Pyflakes: https://github.com/PyCQA/pyflakes/pull/273. Python tests also needed special workaround, see Lib/test/test_sys_settrace.py and issue17288. -- nosy: +serhiy.storchaka

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-02 Thread Gil Forcada
New submission from Gil Forcada : Given the following code: class MyClass(object): @property def my_function(self): pass Parsing it with ast module, the lineno and col_offset of the ast.FunctionDef is reported to be where the decorator starts (i.e. line 3 column