ProtoCaller.Utils.ConditionalList module

class ProtoCaller.Utils.ConditionalList.ConditionalList(input_list, *checkfuncs, transformfunc=None)

Bases: list

A class that conditionally accepts new elements based on user-defined functions.

Parameters
  • input_list (list) – Name of the input list.

  • checkfuncs – Positional arguments which need to be callable. These are the functions which are used to check any added element. These should throw an error if the element should not be a part of the list.

  • transformfunc – A callable which optionally transforms the input after the checks and before addition to the list.