Skip to content

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

Merged
isidentical merged 1 commit into
python:masterfrom
isidentical:bpo-42737
Apr 25, 2021
Merged

bpo-42737: Drop code generation for annotations with complex targets#23952
isidentical merged 1 commit into
python:masterfrom
isidentical:bpo-42737

Conversation

@isidentical

@isidentical isidentical commented Dec 26, 2020

Copy link
Copy Markdown
Member

https://bugs.python.org/issue42737

Automerge-Triggered-By: GH:isidentical

@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
Comment thread Doc/whatsnew/3.10.rst Outdated
Comment thread Lib/importlib/_bootstrap_external.py Outdated
Comment thread Misc/NEWS.d/next/Core and Builtins/2020-12-26-10-37-41.bpo-42737.x4y0ok.rst Outdated
Comment thread Doc/whatsnew/3.10.rst Outdated
@isidentical

Copy link
Copy Markdown
Member Author

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

Comment thread Misc/NEWS.d/next/Core and Builtins/2021-04-22-22-48-30.bpo-42737.lsJ7pD.rst Outdated

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
Copy Markdown

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

@isidentical

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Member

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
Copy Markdown
Member Author

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
Copy Markdown
Member

Fantastic, thanks for explaining!

@miss-islington

Copy link
Copy Markdown
Contributor

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

2 similar comments
@miss-islington

Copy link
Copy Markdown
Contributor

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

@miss-islington

Copy link
Copy Markdown
Contributor

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

@isidentical
isidentical merged commit 8cc3cfa into python:master Apr 25, 2021
Sign up for free to 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.

7 participants