Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cdbbd0a

Browse files
committed
New about super.
1 parent 55c5abb commit cdbbd0a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ Type/class unification and new-style classes
1010
with finalizers. (The "get attribute" and "set attribute" methods
1111
are still called __get__ and __set__, respectively.)
1212

13+
- Some subtle issues with the super built-in were fixed:
14+
15+
(a) When super itself is subclassed, its __get__ method would still
16+
return an instance of the base class (i.e., of super).
17+
18+
(b) super(C, C()).__class__ would return C rather than super. This
19+
is confusing. To fix this, I decided to change the semantics of
20+
super so that it only applies to code attributes, not to data
21+
attributes. After all, overriding data attributes is not
22+
supported anyway.
23+
24+
(c) The __get__ method didn't check whether the argument was an
25+
instance of the type used in creation of the super instance.
26+
27+
1328
Core and builtins
1429

1530
Extension modules

0 commit comments

Comments
 (0)