diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/generic_not_last_base_class.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/generic_not_last_base_class.rs index 7a94219cdc..19565abd56 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/generic_not_last_base_class.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/generic_not_last_base_class.rs @@ -21,27 +21,47 @@ use crate::{Fix, FixAvailability, Violation}; /// /// For example: /// ```python +/// from collections.abc import Container, Iterable, Sized +/// from typing import Generic, TypeVar +/// +/// +/// T = TypeVar("T") +/// K = TypeVar("K") +/// V = TypeVar("V") +/// +/// /// class LinkedList(Generic[T], Sized): /// def push(self, item: T) -> None: /// self._items.append(item) /// +/// /// class MyMapping( /// Generic[K, V], -/// Iterable[Tuple[K, V]], -/// Container[Tuple[K, V]], +/// Iterable[tuple[K, V]], +/// Container[tuple[K, V]], /// ): /// ... /// ``` /// /// Use instead: /// ```python +/// from collections.abc import Container, Iterable, Sized +/// from typing import Generic, TypeVar +/// +/// +/// T = TypeVar("T") +/// K = TypeVar("K") +/// V = TypeVar("V") +/// +/// /// class LinkedList(Sized, Generic[T]): /// def push(self, item: T) -> None: /// self._items.append(item) /// +/// /// class MyMapping( -/// Iterable[Tuple[K, V]], -/// Container[Tuple[K, V]], +/// Iterable[tuple[K, V]], +/// Container[tuple[K, V]], /// Generic[K, V], /// ): /// ...