[New-bugs-announce] [issue45268] use multiple "in" in one expression?

zeroswan report at bugs.python.org
Thu Sep 23 00:37:19 EDT 2021

New submission from zeroswan <zeroswan at outlook.com>:

I find it's a valid expression: `1 in [1, 2, 3] in [4, 5, 6]`

`a in b in c` is equivalent to `a in b and b in c` 

but this expression seems useless, and easy to confused with (a in b) in c .
in this program, what I originally want is `if a in b and a in c` , But it was mistakenly written as `a in b in c`

This expression is similar to `a<b<c` 。
But it seems very unreasonable here, is this a bug ?

components: Parser
messages: 402478
nosy: lys.nikolaou, pablogsal, weditor
priority: normal
severity: normal
status: open
title: use multiple "in" in one expression?
type: behavior
versions: Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list