Skip to content

Commit 0defac5

Browse files
committed
renamed _check -> check_
(Identifiers starting with underscores are reserved by the standard) Also fixed a typo in a comment.
1 parent 6fa316d commit 0defac5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/pybind11/numpy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class array : public buffer {
349349
int flags = 0;
350350
if (base && ptr) {
351351
if (isinstance<array>(base))
352-
/* Copy flags from base (except baseship bit) */
352+
/* Copy flags from base (except ownership bit) */
353353
flags = reinterpret_borrow<array>(base).flags() & ~detail::npy_api::NPY_ARRAY_OWNDATA_;
354354
else
355355
/* Writable by default, easy to downgrade later on if needed */
@@ -639,7 +639,7 @@ template <typename T, int ExtraFlags = array::forcecast> class array_t : public
639639
return result;
640640
}
641641

642-
static bool _check(handle h) {
642+
static bool check_(handle h) {
643643
const auto &api = detail::npy_api::get();
644644
return api.PyArray_Check_(h.ptr())
645645
&& api.PyArray_EquivTypes_(detail::array_proxy(h.ptr())->descr, dtype::of<T>().ptr());

include/pybind11/pytypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ template <typename T> T reinterpret_steal(handle h) { return {h, object::stolen}
282282
`object` or a class which was exposed to Python as ``py::class_<T>``.
283283
\endrst */
284284
template <typename T, detail::enable_if_t<std::is_base_of<object, T>::value, int> = 0>
285-
bool isinstance(handle obj) { return T::_check(obj); }
285+
bool isinstance(handle obj) { return T::check_(obj); }
286286

287287
template <typename T, detail::enable_if_t<!std::is_base_of<object, T>::value, int> = 0>
288288
bool isinstance(handle obj) { return detail::isinstance_generic(obj, typeid(T)); }
@@ -572,7 +572,7 @@ NAMESPACE_END(detail)
572572
Name(handle h, stolen_t) : Parent(h, stolen) { } \
573573
PYBIND11_DEPRECATED("Use py::isinstance<py::python_type>(obj) instead") \
574574
bool check() const { return m_ptr != nullptr && (bool) CheckFun(m_ptr); } \
575-
static bool _check(handle h) { return h.ptr() != nullptr && CheckFun(h.ptr()); }
575+
static bool check_(handle h) { return h.ptr() != nullptr && CheckFun(h.ptr()); }
576576

577577
#define PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun) \
578578
PYBIND11_OBJECT_COMMON(Name, Parent, CheckFun) \

0 commit comments

Comments
 (0)