-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Using base class docstring does not work for properties #4126
Copy link
Copy link
Closed
Description
Subject: Docstring for Python properties that do not have one should be inherited from the same property in the parent class.
Problem
I checked out the latest Sphinx version to test out the generation of docstrings for methods and properties that do not have one declared explicitly, but there is one in the base class (#3140). It seems that the docstring generation works for methods, but it does not for properties
Expected results
That both methods and properties inherit their documentation from the respective property/method in the parent class (currently only methods does so).
Reproducible project / your project
class Base(object):
@property
# it does not work with or without the abstractmethod decorator
#@abc.abstractmethod
def my_property(self):
"""int: Some value"""
raise NotImplementedError
def my_method(self):
"""My method that does nothing"""
raise NotImplementedError
class Ext(Base):
@property
def my_property(self):
return 0
def my_method(self):
passEnvironment info
- OS: macOS
- Python version: 2.7.13
- Sphinx version: Sphinx-1.7.dev20171008
Reactions are currently unavailable