mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-08 23:39:12 +00:00
pybind11: implicitly convert NumPy integer scalars
The current integer caster was unnecessarily strict and rejected various kinds of NumPy integer types when calling C++ functions expecting normal integers. This relaxes the current behavior.
This commit is contained in:
@@ -238,3 +238,10 @@ def test_numpy_view(capture):
|
||||
assert capture == """
|
||||
~ArrayClass()
|
||||
"""
|
||||
|
||||
|
||||
@pytest.requires_numpy
|
||||
def test_cast_numpy_int64_to_uint64():
|
||||
from pybind11_tests.array import function_taking_uint64
|
||||
function_taking_uint64(123)
|
||||
function_taking_uint64(np.uint64(123))
|
||||
|
||||
Reference in New Issue
Block a user