[docs] [issue19054] Descriptors howto

Marco Buttu report at bugs.python.org
Sat Sep 21 15:03:31 CEST 2013

Marco Buttu added the comment:

By looking at the other examples in the howto, I saw there is the same problem in all the definitions in the prompt, and furthermore, we are using a different number of spaces to indent MyClass respect the rest of the classes defined in the prompt. 
There is also a wrong indentation in the StaticMethod definition (no prompt definition):

class StaticMethod(object):
 "Emulate PyStaticMethod_Type() in Objects/funcobject.c"

 def __init__(self, f):
      self.f = f

 def __get__(self, obj, objtype=None):
      return self.f

Applying the py3full.patch, the howto passes all the documentation tests:

$ python -m doctest descriptor.rst | tail -n 1
***Test Failed*** 18 failures.
$ python -m doctest descriptor_modified.rst | tail -n 1

My 2 cents

Added file: http://bugs.python.org/file31834/py3full.patch

Python tracker <report at bugs.python.org>

More information about the docs mailing list