(
zelf: &Py<Self>,
other: &PyObject,
op: PyComparisonOp,
vm: &VirtualMachine,
)
| 693 | |
| 694 | impl Comparable for PyBytes { |
| 695 | fn cmp( |
| 696 | zelf: &Py<Self>, |
| 697 | other: &PyObject, |
| 698 | op: PyComparisonOp, |
| 699 | vm: &VirtualMachine, |
| 700 | ) -> PyResult<PyComparisonValue> { |
| 701 | Ok(if let Some(res) = op.identical_optimization(zelf, other) { |
| 702 | res.into() |
| 703 | } else if other.fast_isinstance(vm.ctx.types.memoryview_type) |
| 704 | && op != PyComparisonOp::Eq |
| 705 | && op != PyComparisonOp::Ne |
| 706 | { |
| 707 | return Err(vm.new_type_error(format!( |
| 708 | "'{}' not supported between instances of '{}' and '{}'", |
| 709 | op.operator_token(), |
| 710 | zelf.class().name(), |
| 711 | other.class().name() |
| 712 | ))); |
| 713 | } else { |
| 714 | zelf.inner.cmp(other, op, vm) |
| 715 | }) |
| 716 | } |
| 717 | } |
| 718 | |
| 719 | impl Iterable for PyBytes { |
nothing calls this directly
no test coverage detected