I am using a 3rd party library function which reads a set of keywords from a file, and is supposed to return a tuple of values. It does this correctly as long as there are at le
Rather than checking for a length of 1, I'd use the isinstance built-in instead.
>>> isinstance('a_str', tuple) False >>> isinstance(('str1', 'str2', 'str3'), tuple) True