(&self, a: &PyObject, b: &PyObject)
| 442 | } |
| 443 | |
| 444 | pub fn _iadd(&self, a: &PyObject, b: &PyObject) -> PyResult { |
| 445 | let result = self.binary_iop1(a, b, PyNumberBinaryOp::InplaceAdd, PyNumberBinaryOp::Add)?; |
| 446 | if !result.is(&self.ctx.not_implemented) { |
| 447 | return Ok(result); |
| 448 | } |
| 449 | // Check inplace_concat or concat slot directly, matching PyNumber_InPlaceAdd behavior |
| 450 | let seq = a.sequence_unchecked(); |
| 451 | let slots = seq.slots(); |
| 452 | if let Some(f) = slots.inplace_concat.load().or_else(|| slots.concat.load()) { |
| 453 | let result = f(seq, b, self)?; |
| 454 | if !result.is(&self.ctx.not_implemented) { |
| 455 | return Ok(result); |
| 456 | } |
| 457 | } |
| 458 | Err(self.new_unsupported_bin_op_error(a, b, "+=")) |
| 459 | } |
| 460 | |
| 461 | pub fn _mul(&self, a: &PyObject, b: &PyObject) -> PyResult { |
| 462 | let result = self.binary_op1(a, b, PyNumberBinaryOp::Multiply)?; |
no test coverage detected