Skip to content

Commit

Permalink
Revert "fix: updated pyclass heighten check to validate for eq and or…
Browse files Browse the repository at this point in the history
…d, fixing Ok issue in eq implementation."

This reverts commit a37c24b.
  • Loading branch information
MG committed Jul 17, 2024
1 parent a37c24b commit 35f1ed9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion pyo3-macros-backend/src/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ fn pyclass_richcmp(
op: #pyo3_path::pyclass::CompareOp
) -> #pyo3_path::PyResult<#pyo3_path::PyObject> {
let self_val = self;
if let ::std::result::Result::Ok(other) = #pyo3_path::types::PyAnyMethods::downcast::<Self>(other) {
if let Ok(other) = #pyo3_path::types::PyAnyMethods::downcast::<Self>(other) {
let other = &*other.borrow();
match op {
#arms
Expand Down
9 changes: 0 additions & 9 deletions src/tests/hygiene/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ pub struct Foo4 {
field: u32,
}

#[crate::pyclass(eq, ord)]
#[pyo3(crate = "crate")]
#[derive(PartialEq, PartialOrd)]
pub struct PointEqOrd {
x: u32,
y: u32,
z: u32,
}

#[crate::pyclass(str = "{x}, {y}, {z}")]
#[pyo3(crate = "crate")]
pub struct PointFmt {
Expand Down

0 comments on commit 35f1ed9

Please sign in to comment.