Skip to content

Description of asyncio.Event.clear inconsistent with threading.Event.clear #101359

@paul1261

Description

@paul1261

Documentation

The wording of asyncio.Event.clear is not consistent with threading.Event.clear. The difference can cause programmers to suspect a difference in behavior, which is not the case. The threading.Event wording makes it clear that threads will block on subsequent calls to Event.wait() if the flag is cleared. With the asyncio.Event wording this is less clear, possibly leading programmers to expect a sufficiently quick call to Event.set() will result in some tasks failing to proceed through an await event.wait() expression.

This issue was raised by a question on StackOverflow. I don't see a rationale for the difference in wording.

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