@@ -5,9 +5,11 @@ use std::time::Duration;
55use numpy:: Complex32 ;
66use pyo3:: {
77 exceptions:: { PyRuntimeError , PyValueError } ,
8- pyclass, pyfunction, pymethods,
8+ pyclass,
9+ pyclass:: CompareOp ,
10+ pyfunction, pymethods,
911 types:: { PyComplex , PyInt } ,
10- Py , PyResult ,
12+ IntoPy , Py , PyObject , PyResult , Python ,
1113} ;
1214use qcs:: qpu:: api:: { ConnectionStrategy , ExecutionOptions , ExecutionOptionsBuilder } ;
1315use qcs_api_client_grpc:: models:: controller:: { readout_values, ControllerJobExecutionResult } ;
@@ -231,6 +233,13 @@ impl PyExecutionOptions {
231233 . timeout ( )
232234 . map ( |timeout| timeout. as_secs_f64 ( ) )
233235 }
236+
237+ fn __richcmp__ ( & self , py : Python < ' _ > , other : & Self , op : CompareOp ) -> PyObject {
238+ match op {
239+ CompareOp :: Eq => ( self . as_inner ( ) == other. as_inner ( ) ) . into_py ( py) ,
240+ _ => py. NotImplemented ( ) ,
241+ }
242+ }
234243}
235244
236245py_wrap_type ! {
@@ -305,4 +314,11 @@ impl PyConnectionStrategy {
305314 fn endpoint_id ( endpoint_id : String ) -> PyResult < Self > {
306315 Ok ( Self ( ConnectionStrategy :: EndpointId ( endpoint_id) ) )
307316 }
317+
318+ fn __richcmp__ ( & self , py : Python < ' _ > , other : & Self , op : CompareOp ) -> PyObject {
319+ match op {
320+ CompareOp :: Eq => ( self . as_inner ( ) == other. as_inner ( ) ) . into_py ( py) ,
321+ _ => py. NotImplemented ( ) ,
322+ }
323+ }
308324}
0 commit comments