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

Reword error message for unawaitable types #114091

Closed
Labels
@swfarnsworth

Description

@swfarnsworth

Feature or enhancement

Proposal:

Currently, attempting to await something that cannot be awaited results in this error message:

importasyncioasyncdefmain():await1asyncio.run(main())# TypeError: object int can't be used in 'await' expression

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.

>>>1[2]TypeError:'int'objectisnotsubscriptable

The PR already exists at#114090 but will be amended momentarily to implement changes suggested by Jelle and to resolve failed tests.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp