Files
pybind11/tests
gentlegiantJGC 8ed0dab67f Add float type caster and revert type hint changes to int_ and float_ (#5839)
* Revert type hint changes to int_ and float_

These two types do not support casting from int-like and float-like types.

* Fix tests

* Add a custom py::float_ caster

The default py::object caster only works if the object is an instance of the type.
py::float_ should accept python int objects as well as float.
This caster will pass through float as usual and cast int to float.
The caster handles the type name so the custom one is not required.

* style: pre-commit fixes

* Fix name

* Fix variable

* Try satisfying the formatter

* Rename test function

* Simplify type caster

* Fix reference counting issue

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-27 09:13:21 -07:00
..
2025-08-06 22:32:45 -04:00
2025-05-16 21:58:43 -04:00
2022-02-14 11:36:22 -08:00
2024-10-07 14:12:04 -07:00
2022-02-14 11:36:22 -08:00