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
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/6NEOVXY7I34R4ULS3GDR3W2AGYH7ATQP/
Code of Conduct: http://python.org/psf/codeofconduct/