Hi, On 22/07/15 09:25, Ronald Oussoren wrote:> Hi, > > Another summer with another EuroPython, which means its time again to > try to revive PEP 447… >
IMO, there are two main issues with the PEP and implementation. 1. The implementation as outlined in the PEP is infinitely recursive, since the lookup of "__getdescriptor__" on type must necessarily call type.__getdescriptor__. The implementation (in C) special cases classes that inherit "__getdescriptor__" from type. This special casing should be mentioned in the PEP. 2. The actual implementation in C does not account for the case where the class of a metaclass implements __getdescriptor__ and that method returns a value when called with "__getdescriptor__" as the argument. Why was "__getattribute_super__" rejected as an alternative? No reason is given. "__getattribute_super__" has none of the problems listed above. Making super(t, obj) delegate to t.__super__(obj) seems consistent with other builtin method/classes and doesn't add corner cases to the already complex implementation of PyType_Lookup(). Cheers, Mark _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com