From 64c51a554cce02449d8962e82700350cfa8aef25 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 6 Jan 2016 21:03:35 -0800 Subject: [PATCH] Ensure machine special method(s) include in generated docs Without explicitly mentioning that it should have its docs generated sphinx won't generate docs for it, so ensure that we list __iter__ and __contains__ so that it does get generated docs. Also fixes 'default_start_state' docs which were not showing up since they were on the setter method vs the getter method. Change-Id: I83d02a3604678d16b16f6da5384ff10543af850f --- automaton/machines.py | 8 ++++---- doc/source/api.rst | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/automaton/machines.py b/automaton/machines.py index a1c6c35..1dac13c 100644 --- a/automaton/machines.py +++ b/automaton/machines.py @@ -113,16 +113,16 @@ class FiniteMachine(object): @property def default_start_state(self): - return self._default_start_state - - @default_start_state.setter - def default_start_state(self, state): """Sets the *default* start state that the machine should use. NOTE(harlowja): this will be used by ``initialize`` but only if that function is not given its own ``start_state`` that overrides this default. """ + return self._default_start_state + + @default_start_state.setter + def default_start_state(self, state): if self.frozen: raise excp.FrozenMachine() if state not in self._states: diff --git a/doc/source/api.rst b/doc/source/api.rst index 442b484..cf60b2b 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -11,6 +11,7 @@ Machines .. autoclass:: automaton.machines.FiniteMachine :members: + :special-members: __iter__, __contains__ .. autoclass:: automaton.machines.HierarchicalFiniteMachine :members: