Skip to content

fastparse: add line and column information for extended slices - #8743

Merged
JukkaL merged 2 commits into
python:masterfrom
hauntsaninja:py39_2
May 1, 2020
Merged

fastparse: add line and column information for extended slices#8743
JukkaL merged 2 commits into
python:masterfrom
hauntsaninja:py39_2

Conversation

@hauntsaninja

Copy link
Copy Markdown
Collaborator

Helps with Python 3.9 test failures

Comment threadmypy/fastparse.py Outdated
if isinstance(e.index, SliceExpr):
if (
isinstance(e.index, SliceExpr) or
(sys.version_info <= (3, 9) and isinstance(e.index, TupleExpr))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the version check is only true for versions earlier than 3.9.0 (since version_info has extra components beyond the first three) or up to 3.9.0? Please add a comment about this.

Or could you perhaps use < (3, 9) as the condition?

@hauntsaninjahauntsaninjaApr 30, 2020

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I did mean to use the latter. Changed a couple things and added comments; hopefully the result is more understandable.

Comparison using the ast3 nodes makes things a little clearer, as does
commenting the code.
@JukkaL
JukkaL merged commit 6638ce8 into python:masterMay 1, 2020
@JukkaL

Copy link
Copy Markdown
Collaborator

Thanks!

@gvanrossum

Copy link
Copy Markdown
Member

Oh, thanks for this fix @hauntsaninja! I had been wondering about those diff lines in the CI logs for 3.9.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@hauntsaninja@JukkaL@gvanrossum@emmatyping