docs(lint): list sequence examples in mutable_names_in docstring
Some checks are pending
LiteLLM Rust / rust-lint (push) Waiting to run
LiteLLM Rust / rust-test (push) Waiting to run
LiteLLM Rust / rust-wheel (push) Waiting to run

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mateo 2026-10-09 02:40:43 +00:00
parent 398a8b1224
commit 82ba2a22f3

View file

@ -315,8 +315,8 @@ def _is_literal_subscript(node: ast.AST) -> bool:
def mutable_names_in(annotation: ast.AST) -> Iterator[str]:
"""Yield mutable-collection names anywhere inside an annotation expression.
Matches bare names (`list`, `MutableSequence`) and dotted access (`typing.Dict`,
`collections.deque`, `collections.abc.MutableMapping`), descends through nesting
Matches bare names (`list`, `MutableSequence`) and dotted access (`typing.List`,
`collections.deque`, `collections.abc.MutableSequence`), descends through nesting
(`dict[str, list[int]]`, `tuple[set[int], ...]`) and string forward references.
Skips `Literal[...]` subtrees: their string arguments are values, not forward
references, so `Literal["list"]` is not the `list` type.