cpython: feb1ae9d5381 (original) (raw)

--- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -236,7 +236,8 @@ def _write_atomic(path, data, mode=0o666

Python 3.6b1 3373 (add BUILD_STRING opcode #27078)

Python 3.6b1 3375 (add SETUP_ANNOTATIONS and STORE_ANNOTATION opcodes

#27985)

-# Python 3.6a1 3376 (simplify CALL_FUNCTIONs & BUILD_MAP_UNPACK_WITH_CALL) +# Python 3.6b1 3376 (simplify CALL_FUNCTIONs & BUILD_MAP_UNPACK_WITH_CALL) +# Python 3.6b1 3377 (set class cell from type.new #23722) #

MAGIC must change whenever the bytecode emitted by the compiler may no

longer be understood by older implementations of the eval loop (usually

@@ -245,7 +246,7 @@ def _write_atomic(path, data, mode=0o666

Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array

in PC/launcher.c must also be updated.

-MAGIC_NUMBER = (3376).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3377).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = 'pycache'

--- a/Lib/test/test_super.py +++ b/Lib/test/test_super.py @@ -143,6 +143,87 @@ class TestSuper(unittest.TestCase): return class self.assertIs(X.f(), X)

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+ def test_obscure_super_errors(self): def f(): super()

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,11 @@ What's New in Python 3.6.0 beta 1 Core and Builtins ----------------- +- Issue #23722: The class cell used by zero-argument super() is now

--- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2285,7 +2285,7 @@ static PyObject * type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) { PyObject *name, *bases = NULL, *orig_dict, *dict = NULL;

assert(args != NULL && PyTuple_Check(args)); assert(kwds == NULL || PyDict_Check(kwds)); @@ -2559,7 +2560,7 @@ type_new(PyTypeObject *metatype, PyObjec } et->ht_qualname = qualname ? qualname : et->ht_name; Py_INCREF(et->ht_qualname);

/* Set tp_doc to a copy of dict['doc'], if the latter is there @@ -2685,6 +2686,14 @@ type_new(PyTypeObject *metatype, PyObjec else type->tp_free = PyObject_Del;

+ /* Initialize the rest */ if (PyType_Ready(type) < 0) goto error;

--- a/PC/launcher.c +++ b/PC/launcher.c @@ -1089,7 +1089,7 @@ static PYC_MAGIC magic_values[] = { { 3190, 3230, L"3.3" }, { 3250, 3310, L"3.4" }, { 3320, 3351, L"3.5" },

--- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -54,7 +54,7 @@ const char *Py_FileSystemDefaultEncodeEr static PyObject * builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) {

--- a/Python/compile.c +++ b/Python/compile.c @@ -1968,7 +1968,7 @@ compiler_class(struct compiler *c, stmt_ return 0; } if (c->u->u_ste->ste_needs_class_closure) {

@@ -1981,15 +1981,20 @@ compiler_class(struct compiler *c, stmt_ return 0; } assert(i == 0);

+ ADDOP_I(c, LOAD_CLOSURE, i);

--- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -242,7 +242,7 @@ const unsigned char _Py_M__importlib_ext 101,95,97,116,111,109,105,99,106,0,0,0,115,26,0,0, 0,0,5,16,1,6,1,26,1,2,3,14,1,20,1,16, 1,14,1,2,1,14,1,14,1,6,1,114,58,0,0,0,

};