pyo3/newsfragments/4210.added.md
Icxolu d1a7cf400a
add pyclass eq option (#4210)
* add pyclass `eq` option

* prevent manual impl of `__richcmp__` or `__eq__` with `#[pyclass(eq)]`

* add simple enum `eq_int` option

* rearrange names to fix deprecation warning

* add newsfragment and migration

* update docs

---------

Co-authored-by: David Hewitt <mail@davidhewitt.dev>
2024-05-31 14:13:30 +00:00

168 B

Added #[pyclass(eq)] option to generate __eq__ based on PartialEq. Added #[pyclass(eq_int)] for simple enums to implement equality based on their discriminants.