File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -8546,8 +8546,6 @@ def test_valid_uses(self):
8546
8546
self .assertEqual (C4 .__args__ , (P , T ))
8547
8547
self .assertEqual (C4 .__parameters__ , (P , T ))
8548
8548
8549
- # TODO: RUSTPYTHON
8550
- @unittest .expectedFailure
8551
8549
def test_args_kwargs (self ):
8552
8550
P = ParamSpec ('P' )
8553
8551
P_2 = ParamSpec ('P_2' )
Original file line number Diff line number Diff line change @@ -833,11 +833,12 @@ impl Comparable for ParamSpecArgs {
833
833
fn eq (
834
834
zelf : & crate :: Py < ParamSpecArgs > ,
835
835
other : PyObjectRef ,
836
- vm : & VirtualMachine ,
836
+ _vm : & VirtualMachine ,
837
837
) -> PyResult < bool > {
838
- // Check if other has __origin__ attribute
839
- if let Ok ( other_origin) = other. get_attr ( "__origin__" , vm) {
840
- return Ok ( zelf. __origin__ . is ( & other_origin) ) ;
838
+ // First check if other is also ParamSpecArgs
839
+ if let Ok ( other_args) = other. downcast :: < ParamSpecArgs > ( ) {
840
+ // Check if they have the same origin
841
+ return Ok ( zelf. __origin__ . is ( & other_args. __origin__ ) ) ;
841
842
}
842
843
Ok ( false )
843
844
}
@@ -911,11 +912,12 @@ impl Comparable for ParamSpecKwargs {
911
912
fn eq (
912
913
zelf : & crate :: Py < ParamSpecKwargs > ,
913
914
other : PyObjectRef ,
914
- vm : & VirtualMachine ,
915
+ _vm : & VirtualMachine ,
915
916
) -> PyResult < bool > {
916
- // Check if other has __origin__ attribute
917
- if let Ok ( other_origin) = other. get_attr ( "__origin__" , vm) {
918
- return Ok ( zelf. __origin__ . is ( & other_origin) ) ;
917
+ // First check if other is also ParamSpecKwargs
918
+ if let Ok ( other_kwargs) = other. downcast :: < ParamSpecKwargs > ( ) {
919
+ // Check if they have the same origin
920
+ return Ok ( zelf. __origin__ . is ( & other_kwargs. __origin__ ) ) ;
919
921
}
920
922
Ok ( false )
921
923
}
You can’t perform that action at this time.
0 commit comments