50659b6b02
`pyo3-macros-backend` is now compiled with PyO3 cfgs to enable different magic method definitions based on version. Add check for correct number of arguments on magic methods.
14 lines
162 B
Rust
14 lines
162 B
Rust
use pyo3::prelude::*;
|
|
|
|
#[pyclass]
|
|
struct MyClass {}
|
|
|
|
#[pymethods]
|
|
impl MyClass {
|
|
fn __truediv__(&self) -> PyResult<()> {
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
fn main() {}
|