View source on GitHub
|
Base class establishing interface for stateful value generation.
A ValueGenerator maintains a state, and each time next is called, a new
value is generated and the state is advanced.
Methods
initialize
@abc.abstractmethodinitialize()
Makes an initialized state for the ValueGenerator.
| Returns | |
|---|---|
| An initial state. |
next
@abc.abstractmethodnext( state )
Gets next value and advances the ValueGenerator.
| Args | |
|---|---|
state
|
The current state. |
| Returns | |
|---|---|
| A pair (value, new_state) where value is the next value and new_state is the advanced state. |
View source on GitHub