[New-bugs-announce] [issue4110] A minor slip while typing

John report at bugs.python.org
Sun Oct 12 17:58:53 CEST 2008


New submission from John <vinetouu at gmail.com>:

Hello,

please let me focus your attention to a little slip that was made while
typing a code example in the Python 3.0 documentation. Please visit the
link  
http://docs.python.org/dev/3.0/library/functions.html?highlight=property#property
  and note the 3rd code example which starts like this:

class C(object):
    def __init__(self): self._x = None


This is probably a slip, because it should better be like this:

class C(object):
    def __init__(self):
        self._x = None


And since this is the only method with such coding style used, it's
probably a slip. Please fix this if you have the time to do so. After
all, it's not a very time-consuming thing to do.


P.S.: I have discovered that the code example

class C(object):
    def __init__(self): self._x = None

was used from the documentation of Python 2.5.x which is

class C(object):
    def __init__(self): self._x = None
    def getx(self): return self._x
    def setx(self, value): self._x = value
    def delx(self): del self._x
    x = property(getx, setx, delx, "I'm the 'x' property.")

but the author of the documentation forgot to put the part  self._x =
None  in a new line and indent the code block.

This slip is present in the documentation for both Python 2.6 and Python
3.0. Please fix it if it is doable. Thanks.

----------
assignee: georg.brandl
components: Documentation
messages: 74669
nosy: georg.brandl, vinetou
severity: normal
status: open
title: A minor slip while typing
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4110>
_______________________________________


More information about the New-bugs-announce mailing list