I have a piece of code that needs to run if any of the variables match some strings. The code seems long and not very pythonic:
if candidate_job_title in ('ERROR', 'NOT AVAILABLE') or candidate_company in ('ERROR', 'NOT AVAILABLE') or candidate_location in ('ERROR', 'NOT AVAILABLE'):
# do something
the best I could come up with is this, is there anything else I can do to make it more readable?
if any (v in ('ERROR', 'NOT AVAILABLE') for v in (candidate_job_title, candidate_company, candidate_location):
# do something