update docstring

This commit is contained in:
Nikolay Kim 2017-06-11 23:51:53 -07:00
parent b8559519ca
commit 6204a06cbc
3 changed files with 4 additions and 3 deletions

View File

@ -75,7 +75,7 @@ features = ["extension-module"]
```rust ```rust
#![feature(proc_macro)] #![feature(proc_macro)]
#![macro_use] extern crate pyo3; #[macro_use] extern crate pyo3;
use pyo3::{py, PyResult, Python, PyModule}; use pyo3::{py, PyResult, Python, PyModule};

View File

@ -23,6 +23,7 @@ pub fn py3_init(fnname: &syn::Ident, name: &String) -> Tokens {
pub unsafe extern "C" fn #cb_name() -> *mut ::pyo3::ffi::PyObject { pub unsafe extern "C" fn #cb_name() -> *mut ::pyo3::ffi::PyObject {
use std; use std;
extern crate pyo3 as _pyo3; extern crate pyo3 as _pyo3;
use pyo3::IntoPyPointer;
static mut MODULE_DEF: _pyo3::ffi::PyModuleDef = _pyo3::ffi::PyModuleDef_INIT; static mut MODULE_DEF: _pyo3::ffi::PyModuleDef = _pyo3::ffi::PyModuleDef_INIT;
// We can't convert &'static str to *const c_char within a static initializer, // We can't convert &'static str to *const c_char within a static initializer,

View File

@ -66,11 +66,11 @@
//! # Example //! # Example
//! ``` //! ```
//! #![feature(proc_macro)] //! #![feature(proc_macro)]
//! #![macro_use] extern crate pyo3; //! #[macro_use] extern crate pyo3;
//! use pyo3::{py, Python, PyResult, PyObject, PyModule}; //! use pyo3::{py, Python, PyResult, PyObject, PyModule};
//! //!
//! #[py::modinit(hello)] //! #[py::modinit(hello)]
//! fn init_module(py: Python, m: &PyModule) { //! fn init_module(py: Python, m: &PyModule) -> PyResult<()> {
//! m.add(py, "__doc__", "Module documentation string")?; //! m.add(py, "__doc__", "Module documentation string")?;
//! m.add(py, "run", py_fn!(py, run()))?; //! m.add(py, "run", py_fn!(py, run()))?;
//! Ok(()) //! Ok(())