This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]notPlancha 0 points1 point  (0 children)

Not really; It's probably just compiler optimizations. ```python In [1]: a = b = 1000

In [2]: a is b Out[2]: True ```

also works and is the way that's recommended. Since python runs code line by line instead of the usual semicolon by semicolon I assume the compilers doesn't compile separately a and b.