You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.
Read-only properties: decorated by @getter, which is an alias of CPython's @property.
Write-only properties: decorated by @setter, which is also an alias of CPython's @property
Read-write properties: decorated by @property and @XXX.setter, whose codes are specially handled by Cython
Due to sphinx-doc/sphinx#7448, (3) isn't rendered with the prefix property by Sphinx. Until this gets fix, (3) already stands out from the rest. Nevertheless, my proposal is as follows
Use Returns to document all read-only properties
Use Parameters to document all write-only properties
Heads up: Sphinx is confused by the Attributes used for read-write properties:
docstring of palace.Source.outer_cone_gains:3: WARNING: duplicate object description of palace.Source.gain, other instance in reference/source, use :noindex: for one of them
I suggest using either Parameters or Returns instead then, but I'm not sure which is better.
In continuation of 83315de and sphinx-contrib/napoleon#22: Currently we have three sorta data descriptors:
@getter
, which is an alias of CPython's@property
.@setter
, which is also an alias of CPython's@property
@property
and@XXX.setter
, whose codes are specially handled by CythonDue to sphinx-doc/sphinx#7448, (3) isn't rendered with the prefix property by Sphinx. Until this gets fix, (3) already stands out from the rest. Nevertheless, my proposal is as follows
Returns
to document all read-only propertiesParameters
to document all write-only propertiesAttributes
to document multi-value read-write properties, or when their type needs special attention (at least until Property annotations do not show up in autoclass sphinx-doc/sphinx#7383 gets fix)The text was updated successfully, but these errors were encountered: