Comment

Comment by katee

I'm glad you and squeaky-clean wrote these comments. When I was experimenting in the Python REPL, I was confused by the last line here:

    >>> 100 is 100
    True
    >>> (10 ** 2) is (10 ** 2)
    True
    >>> (10 ** 3) is (10 ** 3)
    False
    >>> 1000 is 1000
    True
I used the disassembler, but I completely missed that although `1000 is 1000` and `(10 3) is (10 3)` both get optimized to nearly identical bytecode they load different constants. I wrote it up in a new post and thanked you both. https://kate.io/blog/2017/08/24/python-constants-in-bytecode...
parent katee 9 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton