Skip to content

Adding generator_stop to compile_future_features#5320

Merged
youknowone merged 3 commits into
RustPython:mainfrom
matheusfgoncalves95:generator-stop
May 13, 2024
Merged

Adding generator_stop to compile_future_features#5320
youknowone merged 3 commits into
RustPython:mainfrom
matheusfgoncalves95:generator-stop

Conversation

@matheusfgoncalves95

@matheusfgoncalves95 matheusfgoncalves95 commented May 13, 2024

Copy link
Copy Markdown
Contributor

As well as some mild formatting.

Fix #4060

Comment thread compiler/codegen/src/compile.rs Outdated
Comment on lines +2913 to +2914
| "compile_future_features" => {}
"generator_stop" => {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this work?

Suggested change
| "compile_future_features" => {}
"generator_stop" => {}
| "compile_future_features"
| "generator_stop" => {}

@matheusfgoncalves95 matheusfgoncalves95 May 13, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, my autoformatter led to that silly mistake. I also somehow introduced compile_future_features there!

To answer your question: it seems to work.

I did a quick check on the Python interpreter and the import succeeds. The module also looks okay via dir() inspection.

Anyhow, I will fix it. Thanks for pointing that out.

@youknowone youknowone 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.

Thank you for contributing! Your patch also fixed a test in test_contextlib. Could you also update the test? Removing @unittest.expectedFailure will fix the CI failure

@youknowone youknowone merged commit 515f0bf into RustPython:main May 13, 2024
@matheusfgoncalves95 matheusfgoncalves95 deleted the generator-stop branch May 13, 2024 21:52
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.

allow from __future__ import generator_stop

3 participants