reexport `PyAnyMethods` and friends from `pyo3::types` (#3895)

* reexport `PyAnyMethods` and friends from `pyo3::types`

* remove duplicated imports
This commit is contained in:
Icxolu 2024-02-24 14:46:59 +01:00 committed by GitHub
parent 0f29feca8f
commit c06bb8f1f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 24 deletions

View File

@ -87,8 +87,6 @@
//! # if another hash table was used, the order could be random
//! ```
use crate::types::any::PyAnyMethods;
use crate::types::dict::PyDictMethods;
use crate::types::*;
use crate::{Bound, FromPyObject, IntoPy, PyErr, PyObject, Python, ToPyObject};
use std::{cmp, hash};
@ -137,8 +135,6 @@ where
#[cfg(test)]
mod test_indexmap {
use crate::types::any::PyAnyMethods;
use crate::types::dict::PyDictMethods;
use crate::types::*;
use crate::{IntoPy, PyObject, Python, ToPyObject};

View File

@ -39,6 +39,7 @@ pub use crate::types::mapping::PyMappingMethods;
pub use crate::types::module::PyModuleMethods;
pub use crate::types::sequence::PySequenceMethods;
pub use crate::types::set::PySetMethods;
pub use crate::types::slice::PySliceMethods;
pub use crate::types::string::PyStringMethods;
pub use crate::types::traceback::PyTracebackMethods;
pub use crate::types::tuple::PyTupleMethods;

View File

@ -1,13 +1,13 @@
//! Various types defined by the Python interpreter such as `int`, `str` and `tuple`.
pub use self::any::PyAny;
pub use self::boolobject::PyBool;
pub use self::bytearray::PyByteArray;
pub use self::bytes::PyBytes;
pub use self::capsule::PyCapsule;
pub use self::any::{PyAny, PyAnyMethods};
pub use self::boolobject::{PyBool, PyBoolMethods};
pub use self::bytearray::{PyByteArray, PyByteArrayMethods};
pub use self::bytes::{PyBytes, PyBytesMethods};
pub use self::capsule::{PyCapsule, PyCapsuleMethods};
#[cfg(not(Py_LIMITED_API))]
pub use self::code::PyCode;
pub use self::complex::PyComplex;
pub use self::complex::{PyComplex, PyComplexMethods};
#[allow(deprecated)]
#[cfg(not(Py_LIMITED_API))]
pub use self::datetime::timezone_utc;
@ -16,37 +16,37 @@ pub use self::datetime::{
timezone_utc_bound, PyDate, PyDateAccess, PyDateTime, PyDelta, PyDeltaAccess, PyTime,
PyTimeAccess, PyTzInfo, PyTzInfoAccess,
};
pub use self::dict::{IntoPyDict, PyDict};
pub use self::dict::{IntoPyDict, PyDict, PyDictMethods};
#[cfg(not(PyPy))]
pub use self::dict::{PyDictItems, PyDictKeys, PyDictValues};
pub use self::ellipsis::PyEllipsis;
pub use self::float::PyFloat;
pub use self::float::{PyFloat, PyFloatMethods};
#[cfg(all(not(Py_LIMITED_API), not(PyPy)))]
pub use self::frame::PyFrame;
pub use self::frozenset::{PyFrozenSet, PyFrozenSetBuilder};
pub use self::frozenset::{PyFrozenSet, PyFrozenSetBuilder, PyFrozenSetMethods};
pub use self::function::PyCFunction;
#[cfg(all(not(Py_LIMITED_API), not(PyPy)))]
pub use self::function::PyFunction;
pub use self::iterator::PyIterator;
pub use self::list::PyList;
pub use self::mapping::PyMapping;
pub use self::list::{PyList, PyListMethods};
pub use self::mapping::{PyMapping, PyMappingMethods};
pub use self::memoryview::PyMemoryView;
pub use self::module::PyModule;
pub use self::module::{PyModule, PyModuleMethods};
pub use self::none::PyNone;
pub use self::notimplemented::PyNotImplemented;
pub use self::num::PyLong;
pub use self::num::PyLong as PyInt;
#[cfg(not(PyPy))]
pub use self::pysuper::PySuper;
pub use self::sequence::PySequence;
pub use self::set::PySet;
pub use self::slice::{PySlice, PySliceIndices};
pub use self::sequence::{PySequence, PySequenceMethods};
pub use self::set::{PySet, PySetMethods};
pub use self::slice::{PySlice, PySliceIndices, PySliceMethods};
#[cfg(not(Py_LIMITED_API))]
pub use self::string::PyStringData;
pub use self::string::{PyString, PyString as PyUnicode};
pub use self::traceback::PyTraceback;
pub use self::tuple::PyTuple;
pub use self::typeobject::PyType;
pub use self::string::{PyString, PyString as PyUnicode, PyStringMethods};
pub use self::traceback::{PyTraceback, PyTracebackMethods};
pub use self::tuple::{PyTuple, PyTupleMethods};
pub use self::typeobject::{PyType, PyTypeMethods};
/// Iteration over Python collections.
///
@ -332,7 +332,7 @@ mod num;
mod pysuper;
pub(crate) mod sequence;
pub(crate) mod set;
mod slice;
pub(crate) mod slice;
pub(crate) mod string;
pub(crate) mod traceback;
pub(crate) mod tuple;