Commit 6d44707
committed
fix(mypy): Use slice assignment for docutils node children manipulation
Replace .clear() + .extend() with slice assignment (node[:] = children)
to fix mypy errors about Sequence[Node] having no .clear() method and
Node having no .extend() method. This is the idiomatic pattern used in
Sphinx's codebase for modifying node children.1 parent 67d2231 commit 6d44707
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
826 | | - | |
827 | | - | |
| 826 | + | |
828 | 827 | | |
829 | 828 | | |
830 | 829 | | |
| |||
1134 | 1133 | | |
1135 | 1134 | | |
1136 | 1135 | | |
1137 | | - | |
1138 | | - | |
| 1136 | + | |
1139 | 1137 | | |
1140 | 1138 | | |
1141 | 1139 | | |
| |||
0 commit comments