> Are you implying that we should deprecate the `in` operator for strings

No, we should definitely keep the `in` operator. We can revisit the best
wording for the error/warning message later, my point is just that it
should be more considerate to beginners than "TypeError: 'str' object is
not iterable".

> Strings *are* collections:

Technically, a [collection](
https://docs.python.org/3/library/collections.abc.html#collections.abc.Collection)
is an iterable sized container, so if strings aren't iterable, they aren't
collections.

> Sometimes we treat strings as if they were pseudo-atomic. And
> sometimes we treat tuples as pseudo-atomic records too. Should tuples no
> longer be iterable? I don't think so.

We treat strings as pseudo-atomic FAR more than we treat tuples as such. If
tuples weren't iterable then tuple unpacking wouldn't work and all hell
would break loose. I don't think this comparison works.
_______________________________________________
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/VT6C6ANUTZ7XR7EL5JAVERZ2QBCKIH7X/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to