pyo3_special_method_derive 0.2.2

Automatically derive Python dunder methods for your Rust code
Documentation

Derive macros to help with Rust PyO3 support.

Please see these docs for the PyDisplay and PyDebug traits which power Str and Repr.

This crate automatically derives the following functions for structs and enums:

  • __str__

  • __repr__

  • __dir__

  • __getattr__

  • __dict__

  • Skip exposure of variants or fields with the #[pyo3_smd(skip)] attribute

  • Skip variants or fields for __str__ or __repr__ differently with the #[pyo3_smd_str(skip)] and #[pyo3_smd_repr(skip)] attributes

  • Struct fields which are not pub are skipped automatically