diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 691b194b..19facb0f 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -349,7 +349,7 @@ public: int flags = 0; if (base && ptr) { if (isinstance(base)) - /* Copy flags from base (except baseship bit) */ + /* Copy flags from base (except ownership bit) */ flags = reinterpret_borrow(base).flags() & ~detail::npy_api::NPY_ARRAY_OWNDATA_; else /* Writable by default, easy to downgrade later on if needed */ @@ -639,7 +639,7 @@ public: return result; } - static bool _check(handle h) { + static bool check_(handle h) { const auto &api = detail::npy_api::get(); return api.PyArray_Check_(h.ptr()) && api.PyArray_EquivTypes_(detail::array_proxy(h.ptr())->descr, dtype::of().ptr()); diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 80b802fc..ae0ad780 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -282,7 +282,7 @@ template T reinterpret_steal(handle h) { return {h, object::stolen} `object` or a class which was exposed to Python as ``py::class_``. \endrst */ template ::value, int> = 0> -bool isinstance(handle obj) { return T::_check(obj); } +bool isinstance(handle obj) { return T::check_(obj); } template ::value, int> = 0> bool isinstance(handle obj) { return detail::isinstance_generic(obj, typeid(T)); } @@ -572,7 +572,7 @@ NAMESPACE_END(detail) Name(handle h, stolen_t) : Parent(h, stolen) { } \ PYBIND11_DEPRECATED("Use py::isinstance(obj) instead") \ bool check() const { return m_ptr != nullptr && (bool) CheckFun(m_ptr); } \ - static bool _check(handle h) { return h.ptr() != nullptr && CheckFun(h.ptr()); } + static bool check_(handle h) { return h.ptr() != nullptr && CheckFun(h.ptr()); } #define PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun) \ PYBIND11_OBJECT_COMMON(Name, Parent, CheckFun) \