Use tuples with str.endswith(), supported since Python 2.5