4 ms·
As far as I know, this has been changed in Python 3. See: http://stackoverflow.com/questions/3815359/while-1-vs-for-whiletrue-why-is-there-a-difference http://s
by monkeyfacebag 14y ago
As far as I know, this has been changed in Python 3. See: http://stackoverflow.com/questions/3815359/while-1-vs-for-whiletrue-why-is-there-a-difference http://stackoverflow.com/questions/3815359/while-1-vs-for-wh...
It may be the case that at any given point, the idiomatic way is not the fastest. However, if idioms are widely adopted, the language implementers have good reason to optimize them. I'm not saying that's what happened in this case, but I think it's reasonable claim to make in general.