pyo3/tests/hygiene/pyclass.rs

28 lines
478 B
Rust
Raw Normal View History

2021-10-02 18:44:32 +00:00
#![no_implicit_prelude]
#![allow(unused_variables)]
2021-10-02 19:04:22 +00:00
#[::pyo3::pyclass]
#[derive(::std::clone::Clone)]
pub struct Foo;
#[::pyo3::pyclass]
pub struct Foo2;
2021-10-02 18:44:32 +00:00
#[::pyo3::pyclass(
name = "ActuallyBar",
freelist = 8,
weakref,
unsendable,
subclass,
extends = ::pyo3::types::PyAny,
module = "Spam"
)]
pub struct Bar {
#[pyo3(get, set)]
a: u8,
#[pyo3(get, set)]
b: Foo,
#[pyo3(get, set)]
c: ::std::option::Option<::pyo3::Py<Foo2>>,
}