Merge pull request #7298 from tk0miya/7068_pyproperty_directive

py domain: Add py:property directive to describe a property (refs: #7068)
This commit is contained in:
Takeshi KOMIYA
2021-03-13 21:22:29 +09:00
committed by GitHub
5 changed files with 103 additions and 3 deletions

View File

@@ -316,6 +316,22 @@ The following directives are provided for module and class contents:
.. versionadded:: 4.0
.. rst:directive:: .. py:property:: name
Describes an object property.
.. versionadded:: 4.0
.. rubric:: options
.. rst:directive:option:: abstractmethod
:type: no value
Indicate the property is abstract.
.. rst:directive:option:: type: type of the property
:type: text
.. rst:directive:: .. py:method:: name(parameters)
Describes an object method. The parameters should not include the ``self``
@@ -368,6 +384,10 @@ The following directives are provided for module and class contents:
.. versionadded:: 2.1
.. deprecated:: 4.0
Use :rst:dir:`py:property` instead.
.. rst:directive:option:: staticmethod
:type: no value
@@ -584,6 +604,8 @@ a matching identifier is found:
Reference a data attribute of an object.
.. note:: The role is also able to refer to property.
.. rst:role:: py:exc
Reference an exception. A dotted name may be used.