Skip to content

Commit 8e7ac5d

Browse files
authored
fix native types not implementing is_type_of correctly (#4981)
1 parent fdf62e0 commit 8e7ac5d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

newsfragments/4981.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix `is_type_of` for native types not using same specialized check as `is_type_of_bound`.

src/types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ macro_rules! pyobject_native_type_info(
152152

153153
$(
154154
#[inline]
155-
fn is_type_of_bound(obj: &$crate::Bound<'_, $crate::PyAny>) -> bool {
155+
fn is_type_of(obj: &$crate::Bound<'_, $crate::PyAny>) -> bool {
156156
#[allow(unused_unsafe)]
157157
unsafe { $checkfunction(obj.as_ptr()) > 0 }
158158
}

0 commit comments

Comments
 (0)