mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
Tweak documentation for FBT002
(#6556)
This commit is contained in:
parent
01eceaf0dc
commit
680d171ae5
1 changed files with 3 additions and 2 deletions
|
@ -14,14 +14,15 @@ use crate::rules::flake8_boolean_trap::helpers::{add_if_boolean, is_allowed_func
|
|||
/// Calling a function with boolean default means that the keyword argument
|
||||
/// argument can be omitted, which makes the function call ambiguous.
|
||||
///
|
||||
/// Instead, define the relevant argument as keyword-only.
|
||||
/// Instead, consider defining the relevant argument as a required keyword
|
||||
/// argument to force callers to be explicit about their intent.
|
||||
///
|
||||
/// ## Example
|
||||
/// ```python
|
||||
/// from math import ceil, floor
|
||||
///
|
||||
///
|
||||
/// def round_number(number: float, *, up: bool = True) -> int:
|
||||
/// def round_number(number: float, up: bool = True) -> int:
|
||||
/// return ceil(number) if up else floor(number)
|
||||
///
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue