pyo3/tests/ui/static_ref.rs
David Hewitt 870a4bb20d
deprecate GIL refs in function argument (#3847)
* deprecate GIL Refs in function arguments

* fix deprecated gil refs in function arguments

* add notes on deprecations limitations to migration guide

* Apply suggestions from code review

Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>

* review: Icxolu

* fix proto method extract failure for option

* fix gil refs in examples

---------

Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
2024-03-20 22:35:08 +00:00

15 lines
239 B
Rust

use pyo3::prelude::*;
use pyo3::types::PyList;
#[pyfunction]
fn static_ref(list: &'static Bound<'_, PyList>) -> usize {
list.len()
}
#[pyfunction]
fn static_py(list: &Bound<'static, PyList>) -> usize {
list.len()
}
fn main() {}