The behaviour of early exit is fine (we can't fallback to another option if it's ambiguous). We probably want to default to None, do truthy check , then print a a friendlier message to the user or raise a more meaningful error. This will be useful in the future, to do something like email the user when their meal could not be booked.
next()
is used with no default, this will raiseStopIteration
if not matched: https://github.com/edmundmok/mealpy/blob/a580ab524e95d8e37a0f7484d34add21f842bf41/mealpy/mealpy.py#L88-L93The behaviour of early exit is fine (we can't fallback to another option if it's ambiguous). We probably want to default to
None
, do truthy check , then print a a friendlier message to the user or raise a more meaningful error. This will be useful in the future, to do something like email the user when their meal could not be booked.