Skip to content

Name "__doc__" should be set to docstring in class body #1635

@jdemeyer

Description

@jdemeyer

Accessing the __doc__ attribute within a class in Cython does not work correctly:

class C(object):
    "Class docstring"
    docattr = __doc__

In Python, C.docattr will be 'Class docstring'. In Cython, this does not work: it takes the __doc__ from the module instead of the class.

This issue occurs both for Python classes as well as extension types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions