Commit ea5d85f
committed
Add some types to _mathtext.py
Mypy 1.16.0 flags errors here:
lib/matplotlib/_mathtext.py:2531: error: "Node" has no attribute "width" [attr-defined]
lib/matplotlib/_mathtext.py:2608: error: List item 0 has incompatible type "Kern"; expected "Hlist | Vlist" [list-item]
The check for the attribute _metrics is equivalent to checking for an
instance of Char, since only Char and its subclasses set self._metrics.
Mypy infers an unnecessarily tight type list[Hlist | Vlist] for
spaced_nucleus so we give it a more general one.1 parent 4f26d9a commit ea5d85f
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2524 | 2524 | | |
2525 | 2525 | | |
2526 | 2526 | | |
2527 | | - | |
| 2527 | + | |
2528 | 2528 | | |
2529 | 2529 | | |
2530 | | - | |
| 2530 | + | |
2531 | 2531 | | |
2532 | 2532 | | |
2533 | 2533 | | |
| |||
2603 | 2603 | | |
2604 | 2604 | | |
2605 | 2605 | | |
2606 | | - | |
| 2606 | + | |
2607 | 2607 | | |
2608 | 2608 | | |
2609 | 2609 | | |
| |||
0 commit comments