@@ -406,156 +406,29 @@ result back on the stack.
406406 .. versionadded :: 3.5
407407
408408
409- **Binary operations **
409+ **Binary and in-place operations **
410410
411411Binary operations remove the top of the stack (TOS) and the second top-most
412412stack item (TOS1) from the stack. They perform the operation, and put the
413413result back on the stack.
414414
415- .. opcode :: BINARY_POWER
416-
417- Implements ``TOS = TOS1 ** TOS ``.
418-
419-
420- .. opcode :: BINARY_MULTIPLY
421-
422- Implements ``TOS = TOS1 * TOS ``.
423-
424-
425- .. opcode :: BINARY_MATRIX_MULTIPLY
426-
427- Implements ``TOS = TOS1 @ TOS ``.
428-
429- .. versionadded :: 3.5
430-
431-
432- .. opcode :: BINARY_FLOOR_DIVIDE
433-
434- Implements ``TOS = TOS1 // TOS ``.
435-
436-
437- .. opcode :: BINARY_TRUE_DIVIDE
438-
439- Implements ``TOS = TOS1 / TOS ``.
440-
441-
442- .. opcode :: BINARY_MODULO
443-
444- Implements ``TOS = TOS1 % TOS ``.
445-
446-
447- .. opcode :: BINARY_ADD
448-
449- Implements ``TOS = TOS1 + TOS ``.
450-
451-
452- .. opcode :: BINARY_SUBTRACT
453-
454- Implements ``TOS = TOS1 - TOS ``.
455-
456-
457- .. opcode :: BINARY_SUBSCR
458-
459- Implements ``TOS = TOS1[TOS] ``.
460-
461-
462- .. opcode :: BINARY_LSHIFT
463-
464- Implements ``TOS = TOS1 << TOS ``.
465-
466-
467- .. opcode :: BINARY_RSHIFT
468-
469- Implements ``TOS = TOS1 >> TOS ``.
470-
471-
472- .. opcode :: BINARY_AND
473-
474- Implements ``TOS = TOS1 & TOS ``.
475-
476-
477- .. opcode :: BINARY_XOR
478-
479- Implements ``TOS = TOS1 ^ TOS ``.
480-
481-
482- .. opcode :: BINARY_OR
483-
484- Implements ``TOS = TOS1 | TOS ``.
485-
486-
487- **In-place operations **
488-
489415In-place operations are like binary operations, in that they remove TOS and
490416TOS1, and push the result back on the stack, but the operation is done in-place
491417when TOS1 supports it, and the resulting TOS may be (but does not have to be)
492418the original TOS1.
493419
494- .. opcode :: INPLACE_POWER
495-
496- Implements in-place ``TOS = TOS1 ** TOS ``.
497-
498-
499- .. opcode :: INPLACE_MULTIPLY
500-
501- Implements in-place ``TOS = TOS1 * TOS ``.
502-
503-
504- .. opcode :: INPLACE_MATRIX_MULTIPLY
505-
506- Implements in-place ``TOS = TOS1 @ TOS ``.
507-
508- .. versionadded :: 3.5
509-
510-
511- .. opcode :: INPLACE_FLOOR_DIVIDE
512-
513- Implements in-place ``TOS = TOS1 // TOS ``.
514-
515-
516- .. opcode :: INPLACE_TRUE_DIVIDE
517-
518- Implements in-place ``TOS = TOS1 / TOS ``.
519-
520420
521- .. opcode :: INPLACE_MODULO
421+ .. opcode :: BINARY_OP (op)
522422
523- Implements in-place ``TOS = TOS1 % TOS ``.
423+ Implements the binary and in-place operators (depending on the value of
424+ *op *).
524425
525-
526- .. opcode :: INPLACE_ADD
527-
528- Implements in-place ``TOS = TOS1 + TOS ``.
529-
530-
531- .. opcode :: INPLACE_SUBTRACT
532-
533- Implements in-place ``TOS = TOS1 - TOS ``.
534-
535-
536- .. opcode :: INPLACE_LSHIFT
537-
538- Implements in-place ``TOS = TOS1 << TOS ``.
539-
540-
541- .. opcode :: INPLACE_RSHIFT
542-
543- Implements in-place ``TOS = TOS1 >> TOS ``.
544-
545-
546- .. opcode :: INPLACE_AND
547-
548- Implements in-place ``TOS = TOS1 & TOS ``.
549-
550-
551- .. opcode :: INPLACE_XOR
552-
553- Implements in-place ``TOS = TOS1 ^ TOS ``.
426+ .. versionadded :: 3.11
554427
555428
556- .. opcode :: INPLACE_OR
429+ .. opcode :: BINARY_SUBSCR
557430
558- Implements in-place ``TOS = TOS1 | TOS ``.
431+ Implements ``TOS = TOS1[ TOS] ``.
559432
560433
561434.. opcode :: STORE_SUBSCR
0 commit comments