But it is also possible to place a callable object there instead. This allows you to perform some processing without having to test the return value when expect ends. The callback should take one argument, which is the string matched, the object's match attribute. The function can return any Python object, this value will be returned by the expect method. The cont method allows a callback to signal that the expect method reevaluates the clauses passed to it.
Examples Send the matched string to stdout.
Append the string to a list.