pyo3/tests/ui/traverse.rs

28 lines
444 B
Rust
Raw Normal View History

use pyo3::prelude::*;
use pyo3::PyVisit;
use pyo3::PyTraverseError;
#[pyclass]
struct TraverseTriesToTakePyRef {}
#[pymethods]
impl TraverseTriesToTakePyRef {
fn __traverse__(slf: PyRef<Self>, visit: PyVisit) {}
}
#[pyclass]
struct Class;
#[pymethods]
impl Class {
fn __traverse__(&self, py: Python<'_>, visit: PyVisit<'_>) -> Result<(), PyTraverseError> {
Ok(())
}
fn __clear__(&mut self) {
}
}
fn main() {}