On 2/23/20 5:01 PM, Sebastian Berg wrote:
The main issue is generic code. Sequence like lists and tuples are often iterated over: You work with the elements inside.
However, in the same code, often strings are actually not desired to be handled as sequences. I.e. some code uses strings as sequences of characters, but most code probably uses the meaning that a string is a word, or sentence: the individual character has no useful meaning on its own.
And in this case I don't see the string test as that special. In fact, in most case I would think the structure is normally always built from a single type of sequence, (like always a list) and anything that isn't a list is a terminal (or maybe some other type of structure that would be iterated differently) so you wouldn't actually be checking for strings, but for lists (and iterating further on them). -- Richard Damon