[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8, Python 3.9 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset 68bd9c5691c4899d21cc7fe6cce7cd22b2f5ccb0 by Ivan Levkivskyi (Miss 
Islington (bot)) in branch '3.8':
bpo-18374: fix tests to check the correct thing about line numbers (GH-14659) 
(GH-14672)
https://github.com/python/cpython/commit/68bd9c5691c4899d21cc7fe6cce7cd22b2f5ccb0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14480
pull_request: https://github.com/python/cpython/pull/14672

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset 430a9f44fe22f029ae8cfeecb46621d7e199414b by Ivan Levkivskyi (Carl 
Friedrich Bolz-Tereick) in branch 'master':
bpo-18374: fix tests to check the correct thing about line numbers (GH-14659)
https://github.com/python/cpython/commit/430a9f44fe22f029ae8cfeecb46621d7e199414b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread Carl Friedrich Bolz-Tereick


Change by Carl Friedrich Bolz-Tereick :


--
pull_requests: +14466
pull_request: https://github.com/python/cpython/pull/14659

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-08 Thread miss-islington


miss-islington  added the comment:


New changeset c7be35c2abd598f02a633879133caec356593241 by Miss Islington (bot) 
in branch '3.8':
bpo-18374: fix wrong col_offset of some ast.BinOp instances (GH-14607)
https://github.com/python/cpython/commit/c7be35c2abd598f02a633879133caec356593241


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14460
pull_request: https://github.com/python/cpython/pull/14653

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-08 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset 110a47c4f42cf4db88edc1876899fff8f05190fb by Ivan Levkivskyi (Carl 
Friedrich Bolz-Tereick) in branch 'master':
bpo-18374: fix wrong col_offset of some ast.BinOp instances (GH-14607)
https://github.com/python/cpython/commit/110a47c4f42cf4db88edc1876899fff8f05190fb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread Carl Friedrich Bolz-Tereick


Change by Carl Friedrich Bolz-Tereick :


--
pull_requests: +14423
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14607

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

I think the attached patch fixes the problem. Will create a pull request soon.

--
versions: +Python 3.5 -Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48458/binop-offset.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is between the end position of the left operand and the start position of 
the right operand.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread Carl Friedrich Bolz


Carl Friedrich Bolz  added the comment:

OK, fair enough. That means right now there is no way to find the position of 
the operator using the ast module at the moment, correct?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> in my opinion the col_offsets of the two nodes should be 1 and 3, 
> respectively (the positions of the operators)

Such change was committed once, but it was quickly reverted because it was not 
well discussed and contradicts the documentation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread Aivar Annamaa


Aivar Annamaa  added the comment:

> in my opinion the col_offsets of the two nodes should be 1 and 3, 
> respectively (the positions of the operators)

This would not match the documentation:

> one can get the source segment of a one-line expression node using 
> source_line[node.col_offset : node.end_col_offset]

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread STINNER Victor


STINNER Victor  added the comment:

Pablo, Ivan: this old bug is able CST and AST, things that you know. You may 
want to have a look ;-)

Note: This bug is discussed in 
https://twitter.com/cfbolz/status/1146866203975139328

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +levkivskyi, pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am not sure that changes in compile.c are needed now.

Python/Python-ast.c is generated file. And perhaps it would be better to fix 
CST instead of AST.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage: patch review -> needs patch
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-04 Thread Carl Friedrich Bolz


Carl Friedrich Bolz  added the comment:

FWIW, in my opinion the col_offsets of the two nodes should be 1 and 3, 
respectively (the positions of the operators).

--
nosy: +Carl.Friedrich.Bolz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2014-08-22 Thread Claudiu Popa

Changes by Claudiu Popa pcmantic...@gmail.com:


--
stage:  - patch review
type:  - behavior
versions: +Python 3.5 -Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18374
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2014-04-17 Thread Sam Kimbrel

Sam Kimbrel added the comment:

Here's a patch that corrects col_offset for binops in both the ast module and 
in the compiler proper. I've incorporated Aivar's test into test_ast.py; if 
there are test suites for compile.c please let me know and I can add something 
there too.

--
keywords: +patch
nosy: +sam.kimbrel
Added file: 
http://bugs.python.org/file34945/18374-binop-col-offset-with-test.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18374
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2013-07-12 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +benjamin.peterson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18374
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2013-07-06 Thread Aivar Annamaa

New submission from Aivar Annamaa:

When parsing following program:

1+2-3

ast.parse gives col_offset=3 to outermost BinOp (as shown by the attached test 
script). Correct col_offset would be 0 for both BinOp-s

--
components: Interpreter Core
files: binop_bug.py
messages: 192394
nosy: Aivar.Annamaa
priority: normal
severity: normal
status: open
title: ast.parse gives wrong position (col_offset) for some BinOp-s
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file30793/binop_bug.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18374
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com