I always thought that "double equals" and "is" meant the same thing in python.

  • 1
    "is" checks if both objects point to the same reference. I'm actually not sure what '1 is 1' would do
  • 0
    @ltlian values are probably evaluated like ==
  • 0
    @ltlian I bet the 1 is pooled and it will return True, but not sure either hmmm
  • 3
    @ltlian `1 is 1` is undefined behaviour (could return true or false) and deprecated, you'll get a SyntaxWarning in python 3.8 I believe and probably an actual error at some point
  • 1
    I always forget what 'is' means. Bill Clinton questioned the meaning of 'is'...
  • 0
    why would it be two separate operators if they meant/did the same thing?
  • 0
    Algorithm at it aga...wait...
Add Comment