Marco Buttu added the comment:

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

otherwise:

    class MyClass:
        pass

This one is awful:

>>> class MyClass:
    pass

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.

----------
Added file: http://bugs.python.org/file31833/py3howto.patch

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

Reply via email to