cpython: 2a5280db601c (original) (raw)

Mercurial > cpython

changeset 103992:2a5280db601c

Issue #28214: Now __set_name__ is looked up on the class instead of the instance. [#28214]

Serhiy Storchaka storchaka@gmail.com
date Wed, 21 Sep 2016 15:55:49 +0300
parents 873abecbf43a(current diff)1a2b8398f045(diff)
children 141d21808405
files Misc/NEWS
diffstat 3 files changed, 22 insertions(+), 5 deletions(-)[+] [-] Lib/test/test_subclassinit.py 12 Misc/NEWS 3 Objects/typeobject.c 12

line wrap: on

line diff

--- a/Lib/test/test_subclassinit.py +++ b/Lib/test/test_subclassinit.py @@ -148,6 +148,18 @@ class Test(unittest.TestCase): class A: d = Descriptor()

+

+

+ def test_set_name_init_subclass(self): class Descriptor: def set_name(self, owner, name):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1 Core and Builtins ----------------- +- Issue #28214: Now set_name is looked up on the class instead of the

--- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6990,19 +6990,21 @@ update_all_slots(PyTypeObject* type) static int set_names(PyTypeObject *type) {