[New-bugs-announce] [issue23984] Documentation error: Descriptors

bjonnh report at bugs.python.org
Fri Apr 17 06:42:08 CEST 2015


New submission from bjonnh:

in
https://docs.python.org/3.5/howto/descriptor.html#static-methods-and-class-methods

(same problem in all python 3.x documentations)

There is this example where the return of f function is printed and there is already a print in the function:
"""
>>> class E(object):
     def f(x):
          print(x)
     f = staticmethod(f)

>>> print(E.f(3))
3
>>> print(E().f(3))
3
"""

It should probably be:

"""
def f(x):
    return(x)
"""

or 

"""
>> E.f(3)
3
>> E().f(3)
"""

----------
assignee: docs at python
components: Documentation
messages: 241312
nosy: bjonnh, docs at python
priority: normal
severity: normal
status: open
title: Documentation error: Descriptors
type: enhancement
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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


More information about the New-bugs-announce mailing list