This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年03月10日 18:01 by Damjan.Košir, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg155329 - (view) | Author: Damjan Košir (Damjan.Košir) | Date: 2012年03月10日 18:01 | |
In operator acts like it doesn't return a boolean value >>> 3 in [1,2,3] == True False and even >>> 3 in [1,2,3] == 3 in [1,2,3] False but somehow if you add ( ) it starts working >>> (3 in [1,2,3]) == True True Tested on OSX 10.7 Python 2.7.1 |
|||
| msg155332 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2012年03月10日 18:11 | |
Chaining comparison operators inserts implicit "and" conditions: a OP b OP c OP d is equivalent to (a OP b) and (b OP c) and (c OP d) This is most useful with ==, <, <= and so forth, but "in" and "is" also count as comparison ops and have the same precedence. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:27 | admin | set | github: 58455 |
| 2012年03月10日 18:11:06 | georg.brandl | set | status: open -> closed nosy: + georg.brandl messages: + msg155332 resolution: not a bug |
| 2012年03月10日 18:01:02 | Damjan.Košir | create | |