Commit 4cefc05
Relax type hints for xy and xytext in annotate (matplotlib#31428)
* Relax type hints for xy and xytext in annotate
The current type hints for xy and xytext are too strict (tuple[float, float]) compared to the actual flexibility supported at runtime (example, dates, etc).
This change relaxes the type hints to better reflect real usage.
* Apply suggestion from @timhoffm
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
* Change types of xy and xytext parameters to Any
Update pyplot.py annotate function to use tuple[Any, Any] for xy and xytext parameters to match _axes.pyi changes and reflect actual runtime behavior of the API.
---------
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>1 parent 04371c0 commit 4cefc05
2 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
| 136 | + | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3033 | 3033 | | |
3034 | 3034 | | |
3035 | 3035 | | |
3036 | | - | |
3037 | | - | |
| 3036 | + | |
| 3037 | + | |
3038 | 3038 | | |
3039 | 3039 | | |
3040 | 3040 | | |
| |||
0 commit comments