doxysphinx.utils.iterators#

The iterators module contains several iterator related helper functions.

Module Contents#

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.

Attributes#

T

Predicate

Action

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])[source]#

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])[source]#

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[source]#

Apply the action function to all elements.

Parameters:
  • iterable – The input iterable (list etc…)

  • action – The action to apply