1. Georg Brandl
  2. sphinx

Pull requests

#157 Merged
Repository
David_Ham
Branch
default
Repository
birkenfeld
Branch
default

Remove spurious signatures from @property decorated attributes

Author
  1. David Ham
Reviewers
Description

Imagine the following scenario. foo.pyx is a Cython module with contents as follows:

# cython: embedsignature=True
class Bar(object):
    def __init__(self):
        pass

    @property
    def myattribute(self):
        """my docstring"""

Cython will now prepend "Bar.myattribute(self)\n" to the docstring as instructed by the embedsignature directive. Currently autodoc will not strip this signature, and it ends up in the Sphinx generated documentation.

This pull request introduces a new mixin, derived from the existing DocstringSignatureMixin. The new mixin strips any signature from the docstring of an attribute, if autodoc_docstring_signature is True.

  • Learn about pull requests

Comments (1)