pyo3_special_method_derive 0.2.4

Automatically derive Python dunder methods for your Rust code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use pyo3::pyclass;
use pyo3_special_method_derive::Dir;

#[pyclass]
#[derive(Dir)]
#[allow(dead_code)]
enum Tester {
    Alpha,
    #[pyo3_smd(skip)]
    Beta,
}

#[test]
fn test_with_dir() {
    let dir = Tester::Beta.__dir__();

    assert!(dir.is_empty());
}