File tree 3 files changed +104
-94
lines changed
3 files changed +104
-94
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ Python::with_gil(|py| {
75
75
76
76
After:
77
77
78
- ``` rust
78
+ ``` rust,ignore
79
79
# use pyo3::prelude::*;
80
80
# use pyo3::types::{PyInt, PyList};
81
81
# fn main() -> PyResult<()> {
@@ -1089,7 +1089,7 @@ An additional advantage of using Rust's indexing conventions for these types is
1089
1089
that these types can now also support Rust's indexing operators as part of a
1090
1090
consistent API:
1091
1091
1092
- ``` rust
1092
+ ``` rust,ignore
1093
1093
#![allow(deprecated)]
1094
1094
use pyo3::{Python, types::PyList};
1095
1095
Original file line number Diff line number Diff line change @@ -330,8 +330,10 @@ For a `&PyAny` object reference `any` where the underlying object is a Python-na
330
330
a list:
331
331
332
332
``` rust
333
+ # #![allow(unused_imports)]
333
334
# use pyo3 :: prelude :: * ;
334
335
# use pyo3 :: types :: PyList ;
336
+ # #[cfg(feature = " gil-refs" )]
335
337
# Python :: with_gil (| py | -> PyResult <()> {
336
338
#[allow(deprecated)] // PyList::empty is part of the deprecated "GIL Refs" API.
337
339
let obj : & PyAny = PyList :: empty (py );
@@ -390,8 +392,10 @@ To see all Python types exposed by `PyO3` consult the [`pyo3::types`][pyo3::type
390
392
** Conversions:**
391
393
392
394
``` rust
395
+ # #![allow(unused_imports)]
393
396
# use pyo3 :: prelude :: * ;
394
397
# use pyo3 :: types :: PyList ;
398
+ # #[cfg(feature = " gil-refs" )]
395
399
# Python :: with_gil (| py | -> PyResult <()> {
396
400
#[allow(deprecated)] // PyList::empty is part of the deprecated "GIL Refs" API.
397
401
let list = PyList :: empty (py );
You can’t perform that action at this time.
0 commit comments