
On Mon, Oct 25, 2021 at 7:40 PM Jeremiah Vivian <nohackingofkrowten@gmail.com> wrote:
I DO expect this thread to be bombarded with negative replies.
Currently, there are `in`/`not in` operators which work like this in Python:
def contains(contains_value, iterable, not_in): for element in iterable: if element == contains_value: return True ^ not_in return False ^ not_in If I wanted to check if an *exact* object is in an iterable, I would have to loop like this (reverse boolean values for implementation of `not is in`): is_in = False for element in iterable: if element is contains_value: is_in = True I would want a more *convenient* way to check for this value. So therefore, there should be `is in`/`not is in` operators to do it better. Is this a valid reason?
What's your use-case? Can you give an example? Sometimes the solution is a different data structure, like an identidict. ChrisA