
Aug. 26, 2013
9:23 a.m.
On Mon, Aug 26, 2013 at 2:50 PM, Clay Sweetser <clay.sweetser@gmail.com> wrote:
Meaning either that one must write either this, and use parenthesis to avoid some obscure order of operations error: def is_enabled(self): return ( (self.connected) and (not self.broadcasting) and (self.mode is 'client') )
I'd be inclined toward this option, especially if some of your expressions are complex checks - the 'and' will short-circuit, a tuple won't. It looks perfectly readable, to me. Side point: I'd be cautious about using 'is' with strings, unless you have some way of guaranteeing that both sides have been interned. ChrisA