Martin Panter added the comment:

Here are some specific changes I suggest:

1. Most confusing: super() uses the MRO of the second argument, not the first.

2. Clarify that is is not just the first argument that is skipped in the MRO, 
it is all preceding classes as well. The first argument does not have to be the 
class at the start of the MRO.

3. Revise signature and use consistent parameter names in text. Currently, 
“obj” and “type2” are only defined in the doc string. Perhaps super(subclass[, 
self]). Or maybe super(type[, obj]), matching error messages, or 
super(thisclass[, self]), matching the special attributes. Type and type2 are 
too confusing for my taste.

4. Link to the glossary rather than getattr().

5. Explain more about unbound super objects, when the second argument is 
omitted. Apparently they are descriptors; when you set them on a class and then 
“get” them in an instance, you get a new version bound to that instance. This 
is obscure, but I feel it might help the general understanding. [It seems you 
cannot bind a super() object to a class this way; maybe that is a bug.]

6. Explain more about “bound” super objects: getting a method from the super 
object binds the method to the second argument. [This also works for getting 
data properties, but not setting or deleting them; see Issue 14965.]

7. Not only isinstance() or issubclass() must be satisfied, but the first 
argument must be a concrete class. Virtual subclassing is not sufficient if the 
subclass is not in the MRO. This would address Issue 20503. Also, the first 
argument should be a derived class, not “object” itself.

----------
versions:  -Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to