On 10 February 2010 03:36, Tim Chase <python.l...@tim.thechases.com> wrote: > Any thoughts on how others make the choice?
There are two criteria that I use here. I'll often tend towards the positive test; it's just that little bit easier to comprehend, I think. On the other hand, if one case is overwhelmingly more common, I'll usually put that first even if it does mean using a negative test. I'm not buying the short-case-first argument. If the code in a case block is long enough for that to matter, it really belongs in a function of its own anyway. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list