> It's worth noting that "in" is defined by the container. Object
> identity and equality aren't actually part of the definition. A lot of
> containers will behave as the OP describes, but strings, notably, do
> not - if you iterate over "caterpillar", you will never see "cat", yet
> it is most definitely contained.
I've been thinking of the `is in` operator using `in` when the iterable is just 
a single mass of items, like a string is just a single mass of characters. Is 
this a good idea?
_______________________________________________
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/NQQ7OWC5FCN2Z7KQL7M6SDXXS3OKFTSJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to