Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Distinguish data descriptors' permissions in their docstrings #102

Closed
McSinyx opened this issue May 13, 2020 · 5 comments
Closed

Distinguish data descriptors' permissions in their docstrings #102

McSinyx opened this issue May 13, 2020 · 5 comments
Assignees
Labels
discussion Design issue documentation Improvements or additions to documentation
Milestone

Comments

@McSinyx
Copy link
Owner

McSinyx commented May 13, 2020

In continuation of 83315de and sphinx-contrib/napoleon#22: Currently we have three sorta data descriptors:

  1. Read-only properties: decorated by @getter, which is an alias of CPython's @property.
  2. Write-only properties: decorated by @setter, which is also an alias of CPython's @property
  3. 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

  1. Use Returns to document all read-only properties
  2. Use Parameters to document all write-only properties
  3. Use Attributes 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)
@McSinyx McSinyx added the documentation Improvements or additions to documentation label May 13, 2020
@McSinyx McSinyx added this to the 1.0 milestone May 13, 2020
@9a24f0
Copy link
Collaborator

9a24f0 commented May 15, 2020

@McSinyx have you forgotten that we have lecture today?

@McSinyx
Copy link
Owner Author

McSinyx commented May 19, 2020

Probably, gentle ping on the issue though!

@McSinyx
Copy link
Owner Author

McSinyx commented May 21, 2020

In the process could you please also fix the docs on return value of Decoder.play?

@McSinyx
Copy link
Owner Author

McSinyx commented Jun 2, 2020

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.

Edit: let's go with Return.

@McSinyx McSinyx added the discussion Design issue label Jun 2, 2020
McSinyx added a commit that referenced this issue Jul 23, 2020
@McSinyx
Copy link
Owner Author

McSinyx commented Aug 2, 2020

I've just scanned for Tuple[ in palace.pyx and it seems that this can be closed now.

@McSinyx McSinyx closed this as completed Aug 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion Design issue documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants