Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Silly Python riddle. Parent comment
Python 2.6:
>>> dis.dis(f) 1 0 LOAD_GLOBAL 0 (g) 3 LOAD_CONST 0 (None) 6 YIELD_VALUE 7 CALL_FUNCTION 1 10 RETURN_VALUE
>>> dis.dis(f) 1 0 LOAD_GLOBAL 0 (g) 3 LOAD_CONST 0 (None) 6 YIELD_VALUE 7 CALL_FUNCTION 1 10 POP_TOP 11 LOAD_CONST 0 (None) 14 RETURN_VALUE
Python 2.6:
Python 2.7: In essence the Python 2.7 compiler decides to throw away the result of the g() function call and replaces it with None. Does anyone understand why?