classification
Title: Non-data descriptors in pydoc
Type: enhancement Stage:
Components: Documentation Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Antony.Lee, docs@python, ethan.furman, rhettinger
Priority: low Keywords:

Created on 2016-01-08 23:21 by Antony.Lee, last changed 2016-09-01 00:24 by rhettinger.

Messages (1)
msg257782 - (view) Author: Antony Lee (Antony.Lee) * Date: 2016-01-08 23:21
Consider the following minimal example:

    class readonlyprop:
        __init__ = lambda self, func: None
        __get__ = lambda self, inst, cls=None: None

    class C:
        def bar(self):
            pass
        @readonlyprop
        def foo(self):
            pass
        def quux(self):
            pass

the output of `pydoc modname.C` is

    <... cropped ...>
    modname.C = class C(builtins.object)
    |  Methods defined here:
    |  
    |  bar(self)
    |  
    |  foo = None
    |  quux(self)
    |  
    |  ----------------------------------------------------------------------
    |  Data descriptors defined here:
    <... cropped ...>

It would be nice if
1. a newline was added after `foo = None`, and
2. foo was *also* marked as being a non-data-descriptor of class readonlyprop (basically what you'd get without invoking the __get__).
History
Date User Action Args
2016-09-01 00:24:18rhettingersetpriority: normal -> low
nosy: + rhettinger

type: enhancement
versions: - Python 3.5
2016-08-31 21:29:22ethan.furmansetnosy: + ethan.furman
2016-01-08 23:21:49Antony.Leecreate