Skip to content

Commit 6c6b78f

Browse files
committed
Remove some old changes
1 parent 2a8072c commit 6c6b78f

File tree

5 files changed

+5
-48
lines changed

5 files changed

+5
-48
lines changed

Doc/library/dis.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ the original TOS1.
420420

421421
.. opcode:: BINARY_OP (op)
422422

423-
Implements the remaining binary operators (depending on the value of *op*).
423+
Implements the binary and in-place operators (depending on the value of
424+
*op*).
424425

425426
.. versionadded:: 3.11
426427

Include/internal/pycore_abstract.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ _PyIndex_Check(PyObject *obj)
1616
return (tp_as_number != NULL && tp_as_number->nb_index != NULL);
1717
}
1818

19-
PyObject *_PyNumber_Op(PyObject *o1, PyObject *o2, unsigned op);
20-
PyObject *_PyNumber_InPlaceOp(PyObject *o1, PyObject *o2, unsigned op);
21-
2219
#ifdef __cplusplus
2320
}
2421
#endif

Lib/importlib/_bootstrap_external.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def _write_atomic(path, data, mode=0o666):
366366
# Python 3.11a1 3461 (JUMP_ABSOLUTE must jump backwards)
367367
# Python 3.11a2 3462 (bpo-44511: remove COPY_DICT_WITHOUT_KEYS, change
368368
# MATCH_CLASS and MATCH_KEYS, and add COPY)
369-
# Python 3.11a3 3464 (Merge numeric BINARY_*/INPLACE_* into BINARY_OP)
369+
# Python 3.11a3 3463 (Merge numeric BINARY_*/INPLACE_* into BINARY_OP)
370370

371371
#
372372
# MAGIC must change whenever the bytecode emitted by the compiler may no
@@ -376,7 +376,7 @@ def _write_atomic(path, data, mode=0o666):
376376
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
377377
# in PC/launcher.c must also be updated.
378378

379-
MAGIC_NUMBER = (3464).to_bytes(2, 'little') + b'\r\n'
379+
MAGIC_NUMBER = (3463).to_bytes(2, 'little') + b'\r\n'
380380
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
381381

382382
_PYCACHE = '__pycache__'

Lib/test/test_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ def assertOpcodeSourcePositionIs(self, code, opcode,
10531053
for instr, position in zip(dis.Bytecode(code), code.co_positions()):
10541054
if instr.opname == opcode:
10551055
occurrence -= 1
1056-
if occurrence == 0:
1056+
if not occurrence:
10571057
self.assertEqual(position[0], line)
10581058
self.assertEqual(position[1], end_line)
10591059
self.assertEqual(position[2], column)

Objects/abstract.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* Abstract Object Interface (many thanks to Jim Fulton) */
22

33
#include "Python.h"
4-
#include "opcode.h"
54
#include "pycore_abstract.h" // _PyIndex_Check()
65
#include "pycore_call.h" // _PyObject_CallNoArgs()
76
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
@@ -1715,46 +1714,6 @@ PyNumber_ToBase(PyObject *n, int base)
17151714
return res;
17161715
}
17171716

1718-
typedef struct {
1719-
const int slot;
1720-
const char name[3];
1721-
const int islot;
1722-
const char iname[4];
1723-
} nb_info;
1724-
1725-
#define NB_INFO(name, slot) \
1726-
{NB_SLOT(nb_##slot), name, NB_SLOT(nb_inplace_##slot), name "="}
1727-
1728-
static nb_info nb_infos[] = {
1729-
[NB_AND] = NB_INFO("&", and),
1730-
[NB_FLOOR_DIVIDE] = NB_INFO("//", floor_divide),
1731-
[NB_LSHIFT] = NB_INFO("<<", lshift),
1732-
[NB_MATRIX_MULTIPLY] = NB_INFO("@", matrix_multiply),
1733-
[NB_OR] = NB_INFO("|", or),
1734-
[NB_RSHIFT] = NB_INFO(">>", rshift),
1735-
[NB_SUBTRACT] = NB_INFO("-", subtract),
1736-
[NB_TRUE_DIVIDE] = NB_INFO("/", true_divide),
1737-
[NB_XOR] = NB_INFO("^", xor),
1738-
};
1739-
1740-
#undef NB_INFO
1741-
1742-
PyObject *
1743-
_PyNumber_Op(PyObject *o1, PyObject *o2, unsigned op)
1744-
{
1745-
assert(op < sizeof(nb_infos) / sizeof(nb_info));
1746-
nb_info *ni = &nb_infos[op];
1747-
return binary_op(o1, o2, ni->slot, ni->name);
1748-
}
1749-
1750-
PyObject *
1751-
_PyNumber_InPlaceOp(PyObject *o1, PyObject *o2, unsigned op)
1752-
{
1753-
assert(op < sizeof(nb_infos) / sizeof(nb_info));
1754-
nb_info *ni = &nb_infos[op];
1755-
return binary_iop(o1, o2, ni->islot, ni->slot, ni->iname);
1756-
}
1757-
17581717

17591718
/* Operations on sequences */
17601719

0 commit comments

Comments
 (0)