implicit conversions #257
-
Int cannot implicit convert to bool? void test_bool(bool a) |
Beta Was this translation helpful? Give feedback.
Answered by
wjakob
Aug 11, 2023
Replies: 1 comment 1 reply
-
nanobind's bool conversion is stricter than the "truthiness" rules in Python. You could modify the type caster to make the behavior more relaxed. The stricter builtin behavior is intentional and I do not wish to change it. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
huangweiwu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nanobind's bool conversion is stricter than the "truthiness" rules in Python. You could modify the type caster to make the behavior more relaxed. The stricter builtin behavior is intentional and I do not wish to change it.