I am experimenting with hierarchical task planning (in python) and I would like to have functions which return lists of tasks. I need to differentiate between alternative paths and sequential tasks. My current approach is to return a list of lists of tasks, e.g.:
def travel(): return [ [call_yellow_cab, ride_yellow_cab, pay_driver], [call_limousine, ride_limousine, pay_driver] ]
The sequential tasks would be call.., ride.., pay_driver. The first and second lists would represent alternative task sequences (cab or limousine).
As 'Explicit is better than implicit' according to 'The Zen of Python' I am curious if there is a more explicit way to differentiate between the alternative tasklists and the sequential tasks within. Or is my approach not that bad as 'Simple is better than complex.' ?