Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation) (issue 25435)
http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst File Doc/howto/descriptor.rst (right): http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst#newc... Doc/howto/descriptor.rst:283: self.f = f I reckon leave this bit out. It is meant to represent the actual function class, not a wrapper. http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst#newc... Doc/howto/descriptor.rst:287: if obj is Null: None not Null http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst#newc... Doc/howto/descriptor.rst:289: return self.f return self http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst#newc... Doc/howto/descriptor.rst:292: return types.MethodType(self.f, obj) MethodType(self, obj) http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst#newc... Doc/howto/descriptor.rst:303: >>> D.f # Get from a class becomes a function as well Get from a class returns the same function http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst#newc... Doc/howto/descriptor.rst:308: The output suggests that bound and unbound methods are two different types. This whole paragraph could be removed IMO. In Python 3, “self” is not allowed to be None, and unbound methods are the original function object. http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst#newc... Doc/howto/descriptor.rst:315: field. If set (meaning bound), the original function (stored in the The only Python 3 relevant bit is the second sentence I think. The rest could be dropped. http://bugs.python.org/review/25435/diff/15789/Doc/howto/descriptor.rst#newc... Doc/howto/descriptor.rst:318: function. The actual C implementation of :func:`instancemethod_call()` is only instancemethod_call seems to be a method of PyInstanceMethod_Type, which is part of the C API, but doesn’t seem to be used at all. Don’t think it is worth mentioning. http://bugs.python.org/review/25435/
participants (1)
-
vadmium+py@gmail.com