Commit d6b33a2
authored
Re-order variants to prioritize narrower types (matplotlib#31504)
As of pybind/pybind11#5879, pybind11 will
convert Python `int` to C `float`/`double`. For `std::variant`, pybind11
will attempt to convert arguments in the order of the type.
So if `double` occurs earlier in the variant, then `int`/`long` will
never be produced. By putting `int`/`long` before `double`, pybind11
will attempt that conversion first and we'll continue to produce our
deprecation warning correctly.
Fixes matplotlib#314951 parent e4f9152 commit d6b33a2
2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments