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

Expand docs for ASYNC109 #13146

Merged
merged 7 commits into from
Sep 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ use crate::settings::types::PythonVersion;
/// ## What it does
/// Checks for `async` functions with a `timeout` argument.
///
/// This rule is only applied for Python 3.11 and newer,
/// as `asyncio.timeout` was added in Python 3.11.
jamesbraza marked this conversation as resolved.
Show resolved Hide resolved
///
/// ## Why is this bad?
/// Rather than implementing asynchronous timeout behavior manually, prefer
/// built-in timeout functionality, such as `asyncio.timeout`, `trio.fail_after`,
/// or `anyio.move_on_after`, among others.
/// built-in timeout functionality, such as `asyncio.timeout`,
/// `trio.fail_after`, or `anyio.move_on_after`, among others.
///
/// If you are abstracting `asyncio` within a function
/// that internally utilizes `asyncio.timeout`,
/// this rule can be disabled, or use a more specific timeout name
/// such as `your_behavior_timeout`.
jamesbraza marked this conversation as resolved.
Show resolved Hide resolved
///
/// ## Example
///
Expand Down
Loading