Author marco.buttu
Recipients docs@python, marco.buttu, rhettinger
Date 2013-09-21.10:44:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I think the indentation is a problem, for several reasons. In all the examples in the documentation, the form by using the interactive shell is the following:

    >>> class MyClass:
    ...     pass


    class MyClass:

This one is awful:

>>> class MyClass:

and in fact it is no used in the doc. So if you want to put the class clause in the interactive shell, you have to add the dots to indent the suite of the compound statement, in order to be consistent with the rest of all the documentation.
But it is not just a problem of beauty:

$ python -m doctest descriptor.rst 
File "descriptor.rst", line 165, in descriptor.rst
Failed example:
    class MyClass(object):
Exception raised:
        class MyClass(object):
    SyntaxError: unexpected EOF while parsing

By applying the patch, the definitions of the classes RevealAccess and MyClass pass the documentation test. The whole example does not pass in any case, because you are not consistent using the shell notation.
Date User Action Args
2013-09-21 10:44:26marco.buttusetrecipients: + marco.buttu, rhettinger, docs@python
2013-09-21 10:44:26marco.buttusetmessageid: <>
2013-09-21 10:44:26marco.buttulinkissue19054 messages
2013-09-21 10:44:26marco.buttucreate