mirror of https://github.com/astral-sh/ruff
parent
401d172e47
commit
fa1341b0db
|
|
@ -27,20 +27,26 @@ use crate::settings::types::PythonVersion;
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```python
|
/// ```python
|
||||||
/// for i in range(10):
|
/// string_numbers: list[str] = ["1", "2", "three", "4", "5"]
|
||||||
|
///
|
||||||
|
/// int_numbers: list[int] = []
|
||||||
|
/// for num in string_numbers:
|
||||||
/// try:
|
/// try:
|
||||||
/// print(i * i)
|
/// int_numbers.append(int(num))
|
||||||
/// except:
|
/// except ValueError as e:
|
||||||
/// break
|
/// print(f"Couldn't convert to integer: {e}")
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Use instead:
|
/// Use instead:
|
||||||
/// ```python
|
/// ```python
|
||||||
|
/// string_numbers: list[str] = ["1", "2", "three", "4", "5"]
|
||||||
|
///
|
||||||
|
/// int_numbers: list[int] = []
|
||||||
/// try:
|
/// try:
|
||||||
/// for i in range(10):
|
/// for num in string_numbers:
|
||||||
/// print(i * i)
|
/// int_numbers.append(int(num))
|
||||||
/// except:
|
/// except ValueError as e
|
||||||
/// break
|
/// print(f"Couldn't convert to integer: {e}")
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ## Options
|
/// ## Options
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue