]> granicus.if.org Git - python/commitdiff
New about super.
authorGuido van Rossum <guido@python.org>
Mon, 3 Dec 2001 15:46:59 +0000 (15:46 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 3 Dec 2001 15:46:59 +0000 (15:46 +0000)
Misc/NEWS

index 69f80ee3d8217d1d2057d1777ca636ec3571c344..d97193d99cd645eb39118805b32a69709716ba04 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,21 @@ Type/class unification and new-style classes
   with finalizers.  (The "get attribute" and "set attribute" methods
   are still called __get__ and __set__, respectively.)
 
+- Some subtle issues with the super built-in were fixed:
+
+  (a) When super itself is subclassed, its __get__ method would still
+      return an instance of the base class (i.e., of super).
+
+  (b) super(C, C()).__class__ would return C rather than super.  This
+      is confusing.  To fix this, I decided to change the semantics of
+      super so that it only applies to code attributes, not to data
+      attributes.  After all, overriding data attributes is not
+      supported anyway.
+
+  (c) The __get__ method didn't check whether the argument was an
+      instance of the type used in creation of the super instance.
+
+
 Core and builtins
 
 Extension modules