From 82ba2a22f320e66eba7f59840bff7d0b6810b857 Mon Sep 17 00:00:00 2001 From: mateo Date: Fri, 9 Oct 2026 02:40:43 +0000 Subject: [PATCH] docs(lint): list sequence examples in mutable_names_in docstring Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- scripts/check_type_discipline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check_type_discipline.py b/scripts/check_type_discipline.py index 3e645e02bc0..a87e1fccc81 100644 --- a/scripts/check_type_discipline.py +++ b/scripts/check_type_discipline.py @@ -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.