how to avoid checking the same condition repeatedly ?

Nobody nobody at nowhere.com
Mon Oct 28 15:37:31 EDT 2013


On Mon, 28 Oct 2013 09:50:19 +0000, Wolfgang Maier wrote:

> So my question is: is there an agreed-upon generally best way of dealing
> with this?

Yes. Just leave the test inside the loop.

If you're sufficiently concerned about performance that you're willing to
trade clarity for it, you shouldn't be using Python in the first place.




More information about the Python-list mailing list