mirror of https://github.com/astral-sh/ruff
Make TC010 docs example more realistic (#19356)
This commit is contained in:
parent
e9b0c33703
commit
7b8161e80d
|
|
@ -23,17 +23,28 @@ use crate::checkers::ast::Checker;
|
|||
///
|
||||
/// ## Example
|
||||
/// ```python
|
||||
/// var: str | "int"
|
||||
/// var: "Foo" | None
|
||||
///
|
||||
///
|
||||
/// class Foo: ...
|
||||
/// ```
|
||||
///
|
||||
/// Use instead:
|
||||
/// ```python
|
||||
/// var: str | int
|
||||
/// from __future__ import annotations
|
||||
///
|
||||
/// var: Foo | None
|
||||
///
|
||||
///
|
||||
/// class Foo: ...
|
||||
/// ```
|
||||
///
|
||||
/// Or, extend the quotes to include the entire union:
|
||||
/// ```python
|
||||
/// var: "str | int"
|
||||
/// var: "Foo | None"
|
||||
///
|
||||
///
|
||||
/// class Foo: ...
|
||||
/// ```
|
||||
///
|
||||
/// ## References
|
||||
|
|
|
|||
Loading…
Reference in New Issue