Commit 7579756
Tim Joseph
fix(tensor_dict): use get_args for TDCompatible type checking
In Python 3.8+, `isinstance` with a `typing.Union` like `TDCompatible` raises a `TypeError`. The correct way to check against a type alias that is a union is to use `get_args` from the `typing` module.
This change updates the type check to `isinstance(value, get_args(TDCompatible))` to ensure correct runtime behavior across supported Python versions.1 parent 18c5668 commit 7579756
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
180 | | - | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| |||
0 commit comments