Skip to content

bpo-35212: fix col_offset in f-strings#19398

Closed
matanagasauce wants to merge 3 commits intopython:mainfrom
matanagasauce:bpo-35212
Closed

bpo-35212: fix col_offset in f-strings#19398
matanagasauce wants to merge 3 commits intopython:mainfrom
matanagasauce:bpo-35212

Conversation

@matanagasauce
Copy link
Copy Markdown

@matanagasauce matanagasauce commented Apr 6, 2020

@pablogsal
Copy link
Copy Markdown
Member

Hi @yangyangxcf. Unfortunately, the ast.c module has changed recently and all the functionality has been ported to some new files under the Parser directory. Could you update your PR for the new layout? If you don't have time, I could do it for you if you wish.

@taleinat
Copy link
Copy Markdown
Contributor

Ping, @yangyangxcf, @pablogsal?

@pablogsal
Copy link
Copy Markdown
Member

Ping, @yangyangxcf, @pablogsal?

This PR still needs to be rebased as per #19398 (comment). As I mentioned, I am fine to take it over if @yangyangxcf is ok with that

@taleinat
Copy link
Copy Markdown
Contributor

Let's give this another couple of weeks then, @pablogsal?

@DanielNoord
Copy link
Copy Markdown
Contributor

DanielNoord commented Mar 16, 2022

I believe this was fixed by #27729.

The reported issues seem similar to what is fixed there. Note that on Python 3.10 this now works as expected:

>>> ast.parse("f'{a}'").body[0].value.values[0].value.col_offset
3
>>> ast.parse("f'{a:b}'").body[0].value.values[0].value.col_offset
3

The other issue in the original report is resolved as well.

Edit: @ericvsmith Gentle ping since you closed the bpo and might want to close this PR as well 😄

@ericvsmith
Copy link
Copy Markdown
Member

@DanielNoord :Thanks for the reminder!

@ericvsmith ericvsmith closed this Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants