On Feb 9, 7:36 pm, Tim Chase wrote:
> Larry Hudson wrote:
> > But a minor rearrangement is simpler, and IMHO clearer:
>
> > if 'mystring' not in s:
> > print 'not found'
> > else:
> > print 'foundit'
> > print 'processing'
>
> I've always vacillated on whether that would better be w
In article ,
Tim Chase wrote:
> Larry Hudson wrote:
> > But a minor rearrangement is simpler, and IMHO clearer:
> >
> > if 'mystring' not in s:
> > print 'not found'
> > else:
> > print 'foundit'
> > print 'processing'
>
> I've always vacillated on whether that would better be w
On 10 February 2010 03:36, Tim Chase 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
On Tue, Feb 9, 2010 at 7:58 PM, Daniel Stutzbach <
dan...@stutzbachenterprises.com> wrote:
> On Tue, Feb 9, 2010 at 9:36 PM, Tim Chase
> wrote:
>
>> removing the "not" from the condition. I admit I choose one over the
>> other based on some gut-feeling aesthetic that I can't really nail down. I
On Tue, Feb 9, 2010 at 9:36 PM, Tim Chase wrote:
> removing the "not" from the condition. I admit I choose one over the other
> based on some gut-feeling aesthetic that I can't really nail down. I think
> one of my major influencing factors revolves around the negative "not"
> portion having one
On 09Feb2010 21:36, Tim Chase wrote:
| Larry Hudson wrote:
| >But a minor rearrangement is simpler, and IMHO clearer:
| >
| >if 'mystring' not in s:
| > print 'not found'
| >else:
| > print 'foundit'
| > print 'processing'
|
| I've always vacillated on whether that would better be wri
Larry Hudson wrote:
But a minor rearrangement is simpler, and IMHO clearer:
if 'mystring' not in s:
print 'not found'
else:
print 'foundit'
print 'processing'
I've always vacillated on whether that would better be written as
Larry does, or as
if 'mystring' in s
print 'f