tests/roots/test-ext-autodoc/target/partialmethod.py
raw| 1 | from functools import partialmethod |
| 2 | |
| 3 | |
| 4 | class Cell: |
| 5 | """An example for partialmethod. |
| 6 | |
| 7 | refs: https://docs.python.org/3/library/functools.html#functools.partialmethod |
| 8 | """ |
| 9 | |
| 10 | def set_state(self, state): |
| 11 | """Update state of cell to *state*.""" |
| 12 | |
| 13 | #: Make a cell alive. |
| 14 | set_alive = partialmethod(set_state, True) |
| 15 | |
| 16 | # a partialmethod with no docstring |
| 17 | set_dead = partialmethod(set_state, False) |