Don't reexport Py_hash_t and Py_ssize_t
This commit is contained in:
parent
378fae9659
commit
4e836cb229
|
@ -169,7 +169,7 @@ impl PyBuffer {
|
|||
unsafe {
|
||||
ffi::PyBuffer_GetPointer(
|
||||
&*self.0 as *const ffi::Py_buffer as *mut ffi::Py_buffer,
|
||||
indices.as_ptr() as *mut usize as *mut ::Py_ssize_t
|
||||
indices.as_ptr() as *mut usize as *mut ffi::Py_ssize_t
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -577,7 +577,7 @@ mod test {
|
|||
#[test]
|
||||
fn test_compatible_size() {
|
||||
// for the cast in PyBuffer::shape()
|
||||
assert_eq!(std::mem::size_of::<::Py_ssize_t>(), std::mem::size_of::<usize>());
|
||||
assert_eq!(std::mem::size_of::<::ffi::Py_ssize_t>(), std::mem::size_of::<usize>());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -134,7 +134,7 @@ macro_rules! py_ssizearg_func {
|
|||
($trait:ident, $class:ident :: $f:ident, $res_type:ty, $conv:expr) => {{
|
||||
#[allow(unused_mut)]
|
||||
unsafe extern "C" fn wrap<T>(slf: *mut ffi::PyObject,
|
||||
arg: $crate::Py_ssize_t) -> *mut $crate::ffi::PyObject
|
||||
arg: $crate::ffi::Py_ssize_t) -> *mut $crate::ffi::PyObject
|
||||
where T: for<'p> $trait<'p> + $crate::PyDowncastFrom
|
||||
{
|
||||
const LOCATION: &'static str = concat!(stringify!($class), ".", stringify!($f), "()");
|
||||
|
|
|
@ -152,7 +152,6 @@ pub mod ffi {
|
|||
pub use ffi3::*;
|
||||
}
|
||||
|
||||
pub use ffi::{Py_ssize_t, Py_hash_t};
|
||||
pub use err::{PyErr, PyResult, PyDowncastError, ToPyErr};
|
||||
pub use objects::*;
|
||||
pub use objectprotocol::ObjectProtocol;
|
||||
|
|
|
@ -85,7 +85,7 @@ pub trait ObjectProtocol {
|
|||
|
||||
/// Retrieves the hash code of the object.
|
||||
/// This is equivalent to the Python expression: 'hash(self)'
|
||||
fn hash(&self) -> PyResult<::Py_hash_t>;
|
||||
fn hash(&self) -> PyResult<ffi::Py_hash_t>;
|
||||
|
||||
/// Returns whether the object is considered to be true.
|
||||
/// This is equivalent to the Python expression: 'not not self'
|
||||
|
|
Loading…
Reference in New Issue