There’s a bug in Python’s interpreter that causes True to equal False (quintenlisowe.medium.com) 4 points by Mockapapella 5y ago ↗ HN
[–] jepler 5y ago ↗ https://docs.python.org/3/reference/expressions.html#compari...It's a surprise to me that like "==" or "<", the "is" comparison operator can be chained. TIL. The author is a bit hyperbolic though.
[–] yorwba 5y ago ↗ This is not a bug, it's the author failing to understand Python's syntax for chained comparisons: a is b is c is equivalent to (a is b) and (b is c) I use this syntax most often with a < b < c to check that all items are in the expected order. [–] Mockapapella 5y ago ↗ Thank you for the explanation, I really appreciate it. I've updated the article to more accurately reflect what goes on under the hood.Is there a way to edit submission titles? Or is that a moderator only thing?
[–] Mockapapella 5y ago ↗ Thank you for the explanation, I really appreciate it. I've updated the article to more accurately reflect what goes on under the hood.Is there a way to edit submission titles? Or is that a moderator only thing?
3 comments
[ 2.3 ms ] story [ 11.6 ms ] threadIt's a surprise to me that like "==" or "<", the "is" comparison operator can be chained. TIL. The author is a bit hyperbolic though.
Is there a way to edit submission titles? Or is that a moderator only thing?