Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-114091: Reword error message for unawaitable types#114090
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
gh-114091: Reword error message for unawaitable types#114090
Uh oh!
There was an error while loading.Please reload this page.
Conversation
"object $type can't be ..." -> "'$type' object can't be ..."
ghost commentedJan 15, 2024 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
This will need a NEWS entry since it's a user-visible change. That means you'll also need to create an issue, then rename this PR with the issue number (e.g., As for the contents, I like the change. What do you think though of instead changing the text of "'int' object is not awaitable'? That is even shorter, seems just as clear, and matches other errors like the subscript one. |
swfarnsworth commentedJan 15, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I agree and will implement this change. |
This doesn't look like something that would require an issue (though it does need a news blurb). IIRC it's possible to have a news entry without an issue? (You can try using the PR number as issue number in the blurb form.) |
I don't think so. |
"can't be used in 'await' expression" -> "can't be awaited"
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
…14090)Reword error message for unawaitable types.
…14090)Reword error message for unawaitable types.
…14090)Reword error message for unawaitable types.
Uh oh!
There was an error while loading.Please reload this page.
Currently, attempting to await something that cannot be awaited results in this error message:
I recently encountered this for the first time when the unawaitable object was a method (which was not being called), and found the phrase "object method" unclear. This PR changes the error message so that the name of the class precedes the word "object" and appears in single quotes. A similar construction appears elsewhere in the code base.
Thank you to@JelleZijlstra and@godlygeek for their input to this PR (though they do not necessarily endorse it).