0
System reboot running itertools, why?
Hello Sololearners, Have you noticed the behavior of the count() function when called from Python Interactive Console? Running this code on you PIC will lead you 100% usage: from itertools import count count(10) After a couple of minutes your computer (I'm running on MacBookPro, macOS 10.13.2, python 3.6.3) become unresponsive and eventually reboot. I totally understand that running into an infinite loop has unpredictable results, but I really believe something has to be fixed, either on macOS, python interpreter or both... Would you mind trying it, specially on Windows ? Do you have any idea as to, why is this loop so aggressive ?
3 Answers
+ 1
No problems here, running on Python 3.6.0, Windows 10, iMac 2012
0
What was the output that you got?
0
run it once as you have it in the code above and it just exits normally, return code 0.
I even put it in an infinite loop and watched the CPU; no signs of issue. Sorry I couldn't help, but happy holidays/Christmas/Saturnalia :)