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

[mypyc] Always emit warnings #14451

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

ichard26
Copy link
Collaborator

For example the warning for "treating generator comprehension as list" doesn't get printed unless there were errors too. This was due to the fact mypyc/build.py was only checking errors.num_errors to decide whether to print messages to STDOUT.

To be honest, the generate_c() logic was pretty messy, so I broke out the message printing logic into a separate helper function and made liberal use of early exits.

Fixes mypyc/mypyc#873 (comment).

For example the warning for "treating generator comprehension as list"
doesn't get printed unless there were errors too. This was due to the
fact mypyc/build.py was only checking errors.num_errors to decide
whether to print messages to STDOUT.

To be honest, the generate_c() logic was pretty messy, so I broke out
the message printing logic into a separate helper function and made
liberal use of early exits.
@ichard26 ichard26 force-pushed the fix-messages-welcome-to-2023 branch from 23bfee1 to 837e71d Compare January 15, 2023 03:13
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Nice, hiding the warnings was confusing. As long as we don't properly support generator expressions, this is a much needed improvement.

@JukkaL JukkaL merged commit e88f4a4 into python:master Jan 16, 2023
@ichard26 ichard26 deleted the fix-messages-welcome-to-2023 branch January 16, 2023 12:06
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.

Generator expressions consumed prematurely in compiled code.
2 participants