Just to elaborate:

1. The statement `'x' and 'y'` will always return `y`, *no matter what*.
2. Then, `'y' in kwargs` will be evaluated
3. Whatever the result of 2 is will be negated.

So your expression is equivalent to `if not 'y' in kwargs`.

Instead of checking for keyword arguments, just make them positional arguments, `x` and `y`. Python does the checking for you.