Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-42737: Drop code generation for annotations with complex targets #23952

Merged
merged 1 commit into from Apr 25, 2021

Conversation

isidentical
Copy link
Sponsor Member

@isidentical isidentical commented Dec 26, 2020

https://bugs.python.org/issue42737

Automerge-Triggered-By: GH:isidentical

@isidentical isidentical requested a review from markshannon as a code owner Dec 26, 2020
@isidentical isidentical requested a review from pablogsal Dec 26, 2020
@isidentical isidentical changed the title bpo-42737: Drop code generation for complex annotation targets bpo-42737: Drop code generation for annotations with complex targets Dec 27, 2020
@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jan 27, 2021
@isidentical isidentical removed the stale Stale PR or inactive for long period of time. label Apr 9, 2021
@python python deleted a comment from github-actions bot Apr 9, 2021
Doc/whatsnew/3.10.rst Outdated Show resolved Hide resolved
Lib/importlib/_bootstrap_external.py Outdated Show resolved Hide resolved
Doc/whatsnew/3.10.rst Outdated Show resolved Hide resolved
@isidentical
Copy link
Sponsor Member Author

isidentical commented Apr 22, 2021

I've updated the branch to the revert of PEP 563.

Copy link
Member

@pablogsal pablogsal left a comment

Thanks, @isidentical for the PR. I think we are missing some tests that exercise the fix, no?

test_annotation_with_complex_target is checking a syntax error, which I don't understand fully since the point of this is to drop side effects like [][print('Hi!')]: int

@bedevere-bot
Copy link

bedevere-bot commented Apr 25, 2021

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@isidentical
Copy link
Sponsor Member Author

isidentical commented Apr 25, 2021

ch I don't understand fully since the point of this is to drop side effects like [][print('Hi!')]: int

No, it is to drop the side effect of the annotation part not the target part. See https://bugs.python.org/issue42737#msg383819

@pablogsal
Copy link
Member

pablogsal commented Apr 25, 2021

ch I don't understand fully since the point of this is to drop side effects like [][print('Hi!')]: int

No, it is to drop the side effect of the annotation part not the target part. See https://bugs.python.org/issue42737#msg383819

Apologies, I have copied a bad example from the issue. But shoudn't we add some test checking that either we don't generate bytecode or that some side effect call or similar is never triggered. Unfortunately I don't see how the syntaxError is relevant in that test

@isidentical
Copy link
Sponsor Member Author

isidentical commented Apr 25, 2021

Apologies, I have copied a bad example from the issue. But shoudn't we add some test checking that either we don't generate bytecode or that some side effect call or similar is never triggered. Unfortunately I don't see how the syntaxError is relevant in that test

The previous version was testing those, though since the test_future suite checks everything out with the new additions to the template it is all verified. And the syntax error is just to ensure that compiler stills checks everything out

@pablogsal
Copy link
Member

pablogsal commented Apr 25, 2021

Fantastic, thanks for explaining!

@isidentical isidentical added the 🤖 automerge PR will be merged once it's been approved and all CI passed label Apr 25, 2021
@miss-islington
Copy link
Contributor

miss-islington commented Apr 25, 2021

@isidentical: Status check is done, and it's a failure .

2 similar comments
@miss-islington
Copy link
Contributor

miss-islington commented Apr 25, 2021

@isidentical: Status check is done, and it's a failure .

@miss-islington
Copy link
Contributor

miss-islington commented Apr 25, 2021

@isidentical: Status check is done, and it's a failure .

@isidentical isidentical merged commit 8cc3cfa into python:master Apr 25, 2021
12 of 14 checks passed
kreathon pushed a commit to kreathon/cpython that referenced this pull request May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 automerge PR will be merged once it's been approved and all CI passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants