[docs] [issue26051] Non-data descriptors in pydoc

Antony Lee report at bugs.python.org
Fri Jan 8 18:21:49 EST 2016

New submission from Antony Lee:

Consider the following minimal example:

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

    class C:
        def bar(self):
        def foo(self):
        def quux(self):

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__).

assignee: docs at python
components: Documentation
messages: 257782
nosy: Antony.Lee, docs at python
priority: normal
severity: normal
status: open
title: Non-data descriptors in pydoc
versions: Python 3.5, Python 3.6

Python tracker <report at bugs.python.org>

More information about the docs mailing list