with_global¶
- guppyft.globals.with_global(initial_state, callback_func, *args, **kwargs)[source]¶
Call a Guppy function in a context where
map_global()provides global state.- Overloads:
Note
All calls to this function currently use the same global variable name to store and provide global state.
- Parameters:
initial_state – The initial state of the global variable.
callback_func – The function to call in the global-enabled context.
*args – Positional arguments to pass to the function.
**kwargs – Keyword arguments to pass to the function.
- Returns:
A tuple containing the final global state followed by the value or values returned by the called function.