I found this question about iterator behavior in Python:
Python and next (iterator) naming names
When I typed the code:
a = iter(list(range(10))) for i in a: print a next(a)
to jupyter-qtconsole return value:
0 2 4 6 8
just like Martin Pieter said when the interpreter does not answer the next(a) call.
However, when I ran the code again in my Bash and IDLE interpreter, the code printed:
0 1 2 3 4 5 6 7 8 9
to the console.
I ran the code:
import platform platform.python_implementation()
in all three environments, and they all said that I ran 'CPython' .
So why does QtConsole suppress the next(a) call when IDLE and Bash are down?
If this helps, I run Python 2.7.9 on Mac OSX and use the Anaconda distribution.
python python-internals interpreter jupyter
Jack st Claire
source share