diff --git a/newsfragments/4981.fixed.md b/newsfragments/4981.fixed.md new file mode 100644 index 00000000000..0ac31b19a11 --- /dev/null +++ b/newsfragments/4981.fixed.md @@ -0,0 +1 @@ +Fix `is_type_of` for native types not using same specialized check as `is_type_of_bound`. diff --git a/src/types/mod.rs b/src/types/mod.rs index e3a317ea33a..637d07d72b6 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -152,7 +152,7 @@ macro_rules! pyobject_native_type_info( $( #[inline] - fn is_type_of_bound(obj: &$crate::Bound<'_, $crate::PyAny>) -> bool { + fn is_type_of(obj: &$crate::Bound<'_, $crate::PyAny>) -> bool { #[allow(unused_unsafe)] unsafe { $checkfunction(obj.as_ptr()) > 0 } }