summaryrefslogtreecommitdiff
path: root/tests/roots/test-ext-autodoc/target/partialmethod.py
blob: 01cf4e7988f37a69fb816d1f18d417684e9562ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# for py34 or above
from functools import partialmethod


class Cell(object):
    """An example for partialmethod.

    refs: https://docs.python.jp/3/library/functools.html#functools.partialmethod
    """

    def set_state(self, state):
        """Update state of cell to *state*."""

    #: Make a cell alive.
    set_alive = partialmethod(set_state, True)

    set_dead = partialmethod(set_state, False)
    """Make a cell dead."""