pyo3/src/prelude.rs

33 lines
1.1 KiB
Rust
Raw Normal View History

2017-07-31 17:42:55 +00:00
// Copyright (c) 2017-present PyO3 Project and Contributors
//! A collection of items you most likely want to have in scope when working with pyo3
2017-07-31 17:42:55 +00:00
//!
//! The purpose of this module is to alleviate imports of many common pyo3 traits
//! by adding a glob import to the top of pyo3 heavy modules:
//!
//! ```
//! # #![allow(unused_imports)]
//! use pyo3::prelude::*;
//! ```
pub use class::*;
pub use objects::*;
pub use objectprotocol::ObjectProtocol;
pub use object::PyObject;
pub use noargs::NoArgs;
2017-07-31 17:42:55 +00:00
pub use python::{Python, ToPyPointer, IntoPyPointer};
pub use err::{PyErr, PyErrValue, PyResult, PyDowncastError, PyErrArguments};
pub use pythonrun::GILGuard;
2017-08-08 07:27:33 +00:00
pub use typeob::PyRawObject;
2017-07-31 17:42:55 +00:00
pub use instance::{PyToken, PyObjectWithToken, AsPyRef, Py, PyNativeType};
pub use conversion::{FromPyObject, PyTryFrom, PyTryInto,
2017-07-31 17:42:55 +00:00
ToPyObject, ToBorrowedObject, IntoPyObject, IntoPyTuple};
pub use pyo3cls::{pyproto, pyclass, pymethods, pyfunction};
#[cfg(Py_3)]
pub use pyo3cls::mod3init as pymodinit;
#[cfg(not(Py_3))]
pub use pyo3cls::mod2init as pymodinit;