On Oct 31, 4:27 pm, Lawrence D'Oliveiro <l...@geek- central.gen.new_zealand> wrote: > In message > <687bcb76-0093-4d68-ba56-0390a3e1e...@30g2000yql.googlegroups.com>, > > cbr...@cbrownsystems.com wrote: > > I should note that efficiency is not an issue to me here; this is for > > when you have, say, a list user_options of at most around 15 options > > or so, and you want to perform some action if one or more of a, b, or > > c is an option listed in user_options. Big O notation isn't so > > relevant as readability and 'naturalness'. > > I must say this whole thread has turned into a massive bikeshedding > exercise.
Agreed that, to paraphrase RWE, a foolish insistence on big O valuation is the hobgoblin of etc. On the other hand, I got a reasonable answer to my question: if any(option in ['optionA', 'optionB', 'optionC'] for option in supplied_options): first_do_something_those_options_all_require() if 'optionA' in supplied_options: do_optionA_specific_stuff() <and so on and so forth...> which is quite readable and flexible as an idiom, and so I am satisfied overall. Cheers - Chas -- http://mail.python.org/mailman/listinfo/python-list