You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Type hint conflict with noconvert float #5878
What version (or hash if on master) of pybind11 are you using?
3.0.1
Problem description
If a float argument is marked as .noconvert() it will only accept python float arguments and will be type hinted as float. PEP 484 says that a float type hint can accept float or int which is in conflict with the type caster.
Activity
gentlegiantJGC commentedon Oct 23, 2025
There is a long (and ongoing) disccussion about the float type hint here
https://discuss.python.org/t/clarifying-the-float-int-complex-special-case/54018
In my personal opinion the decision in PEP 484 was a mistake but one that can't easily be undone.