Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-144261: SyntaxWarning when await an unawaitable constant#144271

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Locked-chess-official wants to merge3 commits intopython:main
base:main
Choose a base branch
Loading
fromLocked-chess-official:await_warning

Conversation

@Locked-chess-official
Copy link
Contributor

@Locked-chess-officialLocked-chess-official commentedJan 27, 2026
edited by bedevere-appbot
Loading

@Locked-chess-official
Copy link
ContributorAuthor

I will check which cause the SyntaxWarning to SyntaxError.

This is on my computer:

image

check_awaitable(compiler* c, expr_ty e)
{
/* Emit a warning when awaiting obvious non-awaitable literal objects. */
switch (e->kind) {
Copy link
Member

Choose a reason for hiding this comment

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

It's better to swap the kinds and only consider kinds that are awaitable. Otherwise, we need to update that list whenever we add a new kind that is not awaitable.

Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

This requires a What's New entry, and tests as well.

@@ -0,0 +1 @@
SyntaxWarning when await an unawaitable constant.
Copy link
Member

Choose a reason for hiding this comment

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

This requires better phrasing. This does not explain anything.

@bedevere-app
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@picnixzpicnixz marked this pull request as draftJanuary 27, 2026 12:47
@picnixz
Copy link
Member

Since the PR is not ready I'm going to put it as a draft for now.

@Locked-chess-official
Copy link
ContributorAuthor

I take a day but fail to find what upgrade "SyntaxWarning" to "SyntaxError".
cc@vstinner Can you work out what happened in test? This is the most important problem.

@Locked-chess-official
Copy link
ContributorAuthor

Maybe-W error is the cause of the SyntaxError. I will change them to like:

asyncdefa():x=1awaitx

to avoid SyntaxWarning

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

Reviewers

@picnixzpicnixzpicnixz requested changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatrieliritkatriel is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Locked-chess-official@picnixz

[8]ページ先頭

©2009-2026 Movatter.jp