25 Oct
2021
25 Oct
'21
10:31 a.m.
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?