Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Commit 1ccc29a

Browse files
committed
PyBinaryFormat: add __eq__/__ne__
1 parent 3d3bc0b commit 1ccc29a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • kernel-abi-check/bindings/python/src

kernel-abi-check/bindings/python/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl PyObjectFile {
167167
}
168168

169169
/// Binary format of an object file
170-
#[derive(Clone, Debug)]
170+
#[derive(Clone, Debug, Eq, PartialEq)]
171171
#[pyclass(name = "BinaryFormat")]
172172
pub enum PyBinaryFormat {
173173
/// COFF (Common Object File Format)
@@ -192,6 +192,14 @@ pub enum PyBinaryFormat {
192192

193193
#[pymethods]
194194
impl PyBinaryFormat {
195+
fn __eq__(&self, other: &Self) -> bool {
196+
self == other
197+
}
198+
199+
fn __ne__(&self, other: &Self) -> bool {
200+
self != other
201+
}
202+
195203
fn __repr__(&self) -> String {
196204
match self {
197205
PyBinaryFormat::Coff => "BinaryFormat.COFF".to_string(),

0 commit comments

Comments
 (0)