Skip to main content
`Ctrl`+`K`

# doxysphinx.utils.iterators

The iterators module contains several iterator related helper functions.

## Attributes

`T` |
`Predicate` |
`Action` |

## Functions

`apply_if`(iterable, check, action) | Apply the action function to each element that matches the predicate.
`apply_if_first`(iterable, check, action) | Apply the action function to the first element that matches the predicate.
`apply`(→ None) | Apply the action function to all elements.

## Module Contents

doxysphinx.utils.iterators.T

doxysphinx.utils.iterators.Predicate

doxysphinx.utils.iterators.Action

doxysphinx.utils.iterators.apply_if(iterable: Iterable[T], check: Predicate[T], action: Action[T])

  Apply the action function to each element that matches the predicate.

  Parameters:

    - iterable – The input iterable (list etc…)

    - check – The predicate to check

    - action – The action to apply

doxysphinx.utils.iterators.apply_if_first(iterable: Iterable[T], check: Predicate[T], action: Action[T])

  Apply the action function to the first element that matches the predicate.

  Parameters:

    - iterable – The input iterable (list etc…)

    - check – The predicate to check

    - action – The action to apply

doxysphinx.utils.iterators.apply(iterable: Iterable[T], action: Action[T]) → None

  Apply the action function to all elements.

  Parameters:

    - iterable – The input iterable (list etc…)

    - action – The action to apply