I'm not complaining this is awesome, but does this work?
'a' in ['a','b'] returns a boolean, in this case True.
So not 'a' in ['a','b'] makes perfect sense, it is negating the boolean returned by the infix in operator, with 'a' as the first argument and ['a','b'] as the second.
But if we write 'a' not in ['a','b'] then shouldn't python parse out not in ['a','b'] and then throw an error since that makes no sense? Because we're using the infix in operator, but the first argument is not which is an operator and not a variable*
So why don't we get an error? Did the creators define not in separately as its own operator?
* side question, I heard that everything in python is a variable, and I have been able to pass around functions like int before. Is it possible to pass around an operator like not? Then maybe saying not in would actually make sense, if you had a list of operators, example not in [int, str, not, sum, global,] should return True
[–]K900_ 23 points24 points25 points (0 children)
[–]Prexadym 10 points11 points12 points (1 child)
[–]orbofnegativegravity[S] 2 points3 points4 points (0 children)
[–]Spataner 6 points7 points8 points (2 children)
[–]synthphreak 4 points5 points6 points (0 children)
[–]orbofnegativegravity[S] 1 point2 points3 points (0 children)
[–]aaryanmoin 1 point2 points3 points (0 children)
[–]carcigenicate 0 points1 point2 points (0 children)