Tweak documentation for FBT002 (#6556)

This commit is contained in:
Tom Kuson 2023-08-14 14:22:48 +01:00 committed by GitHub
parent 01eceaf0dc
commit 680d171ae5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
///
///