Skip to content

Commit

Permalink
Add example of class attributes (#601)
Browse files Browse the repository at this point in the history
We've encountered this in Qiskit documentation. We want them here to
have an example of how Sphinx renders class attributes.

These are attributes specified in the class docstring with the
`Attributes` caption. They are different than properties.
  • Loading branch information
Eric-Arellano authored Mar 26, 2024
1 parent a4cbd3b commit 4606dfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example_docs/api_example/electron.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class Electron:
from api_example import Electron
ELECTRON = Electron(size="2GB", name="QuantumComputing")
Attributes:
size (str): How big the Electron is.
name: What the Electron is called.
"""

# Regression test for https://github.com/Qiskit/qiskit_sphinx_theme/issues/50.
Expand Down
Binary file modified tests/js/tests.js-snapshots/api-docs-class-page-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4606dfd

Please sign in to comment.