b8fb367582
* feat: Add 'ord' option for PyClass and corresponding tests Updated the macros back-end to include 'ord' as an option for PyClass allowing for Python-style ordering comparison of enum variants. Additionally, test cases to verify the proper functioning of this new feature have been introduced. * update: fix formatting with cargo fmt * update: documented added feature in newsfragments * update: updated saved errors for comparison test for invalid pyclass args * update: removed nested match arms and extended cases for ordering instead * update: alphabetically ordered entries * update: added section to class documentation with example for using ord argument. * refactor: reduced duplication of code using closure to process tokens. * update: used ensure_spanned macro to emit compile time errors for uses of ord on complex enums or structs, updated test errors for bad compile cases * fix: remove errant character * update: added note about PartialOrd being required. * feat: implemented ordering for structs and complex enums. Retained the equality logic for simple enums until PartialEq is deprecated. * update: adjusted compile time error checks for missing PartialOrd implementations. Refactored growing set of comparison tests for simple and complex enums and structs into separate test file. * fix: updated with clippy findings * update: added not to pyclass parameters on ord (assumes that eq will be implemented and merged first) * update: rebased on main after merging of `eq` feature * update: format update * update: update all test output and doc tests * Update guide/src/class.md Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com> * Update pyo3-macros-backend/src/pyclass.rs Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com> * Update newsfragments/4202.added.md Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com> * Update guide/pyclass-parameters.md Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com> * update: added note about `ord` implementation with example. * fix doc formatting --------- Co-authored-by: Michael Gilbert <git.3mc1o@aleeas.com> Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com> |
||
---|---|---|
.. | ||
.gitignore | ||
3761.changed.md | ||
3835.added.md | ||
3966.packaging.md | ||
4061.packaging.md | ||
4072.added.md | ||
4078.changed.md | ||
4079.added.md | ||
4086.fixed.md | ||
4095.added.md | ||
4095.changed.md | ||
4098.changed.md | ||
4100.changed.md | ||
4104.fixed.md | ||
4116.fixed.md | ||
4117.fixed.md | ||
4129.changed.md | ||
4148.added.md | ||
4158.added.md | ||
4178.changed.md | ||
4184.packaging.md | ||
4197.added.md | ||
4201.changed.md | ||
4202.added.md | ||
4205.added.md | ||
4206.added.md | ||
4210.added.md | ||
4210.changed.md | ||
4213.added.md | ||
4214.added.md | ||
4226.fixed.md | ||
4228.changed.md | ||
4236.fixed.md |