Skip to content

Commit 7cc2644

Browse files
adamreicholddavidhewitt
authored andcommitted
Fix redundant imports in doc tests thereby fixing the careful CI job.
1 parent 8498003 commit 7cc2644

File tree

6 files changed

+2
-11
lines changed

6 files changed

+2
-11
lines changed

guide/src/exception.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ the module like this, so that it is importable from Python:
3939

4040
```rust
4141
use pyo3::prelude::*;
42-
use pyo3::types::PyModule;
4342
use pyo3::exceptions::PyException;
4443

4544
pyo3::create_exception!(mymodule, CustomError, PyException);

guide/src/trait_bounds.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ The following wrapper will call the Python model from Rust, using a struct to ho
6565

6666
```rust
6767
use pyo3::prelude::*;
68-
use pyo3::types::PyAny;
6968

7069
# pub trait Model {
7170
# fn set_variables(&mut self, inputs: &Vec<f64>);
@@ -125,7 +124,6 @@ Let's add the PyO3 annotations and add a constructor:
125124
# fn get_results(&self) -> Vec<f64>;
126125
# }
127126
# use pyo3::prelude::*;
128-
# use pyo3::types::PyAny;
129127

130128
#[pyclass]
131129
struct UserModel {
@@ -165,7 +163,6 @@ This wrapper will also perform the type conversions between Python and Rust.
165163

166164
```rust
167165
# use pyo3::prelude::*;
168-
# use pyo3::types::PyAny;
169166
#
170167
# pub trait Model {
171168
# fn set_variables(&mut self, inputs: &Vec<f64>);
@@ -334,7 +331,6 @@ We used in our `get_results` method the following call that performs the type co
334331

335332
```rust
336333
# use pyo3::prelude::*;
337-
# use pyo3::types::PyAny;
338334
#
339335
# pub trait Model {
340336
# fn set_variables(&mut self, inputs: &Vec<f64>);
@@ -387,7 +383,6 @@ Let's break it down in order to perform better error handling:
387383

388384
```rust
389385
# use pyo3::prelude::*;
390-
# use pyo3::types::PyAny;
391386
#
392387
# pub trait Model {
393388
# fn set_variables(&mut self, inputs: &Vec<f64>);
@@ -466,7 +461,6 @@ It is also required to make the struct public.
466461

467462
```rust
468463
use pyo3::prelude::*;
469-
use pyo3::types::PyAny;
470464

471465
pub trait Model {
472466
fn set_variables(&mut self, var: &Vec<f64>);

guide/src/types.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ For a `&PyAny` object reference `any` where the underlying object is a `#[pyclas
8989

9090
```rust
9191
# use pyo3::prelude::*;
92-
# use pyo3::{Py, Python, PyAny, PyResult};
9392
# #[pyclass] #[derive(Clone)] struct MyClass { }
9493
# Python::with_gil(|py| -> PyResult<()> {
9594
let obj: &PyAny = Py::new(py, MyClass {})?.into_ref(py);

src/conversion.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ pub trait AsPyPointer {
7575
///
7676
/// ```rust
7777
/// use pyo3::prelude::*;
78-
/// use pyo3::IntoPyPointer;
7978
/// use pyo3::types::PyString;
8079
/// use pyo3::ffi;
8180
///

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/// You can use this macro to test pyfunctions or pyclasses quickly.
2121
///
2222
/// ```
23-
/// use pyo3::{prelude::*, py_run, PyCell};
23+
/// use pyo3::{prelude::*, py_run};
2424
///
2525
/// #[pyclass]
2626
/// #[derive(Debug)]

src/types/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ impl PyAny {
774774
///
775775
/// ```rust
776776
/// use pyo3::prelude::*;
777-
/// use pyo3::types::{PyAny, PyDict, PyList};
777+
/// use pyo3::types::{PyDict, PyList};
778778
///
779779
/// Python::with_gil(|py| {
780780
/// let dict = PyDict::new(py);

0 commit comments

Comments
 (0)