Method
cmp
(
zelf: &Py<Self>,
other: &PyObject,
op: PyComparisonOp,
vm: &VirtualMachine,
)
Source from the content-addressed store, hash-verified
| 118 | |
| 119 | impl Comparable for PyWeak { |
| 120 | fn cmp( |
| 121 | zelf: &Py<Self>, |
| 122 | other: &PyObject, |
| 123 | op: PyComparisonOp, |
| 124 | vm: &VirtualMachine, |
| 125 | ) -> PyResult<crate::function::PyComparisonValue> { |
| 126 | op.eq_only(|| { |
| 127 | let other = class_or_notimplemented!(Self, other); |
| 128 | let both = zelf.upgrade().and_then(|s| other.upgrade().map(|o| (s, o))); |
| 129 | let eq = match both { |
| 130 | Some((a, b)) => vm.bool_eq(&a, &b)?, |
| 131 | None => zelf.is(other), |
| 132 | }; |
| 133 | Ok(eq.into()) |
| 134 | }) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | impl Representable for PyWeak { |
Callers
nothing calls this directly
Tested by
no test coverage detected