On Sep 24, 9:49 pm, Asun Friere <[EMAIL PROTECTED]> wrote:
> On Sep 25, 11:57 am, "Aaron \"Castironpi\" Brady"
>
> <[EMAIL PROTECTED]> wrote:
> > On Sep 24, 8:40 pm, Asun Friere <[EMAIL PROTECTED]> wrote:
> > > ... I think
> > > your last version ('%d thing%s' % (i, 's' if i != 1 else '')), holding
On Sep 25, 11:57 am, "Aaron \"Castironpi\" Brady"
<[EMAIL PROTECTED]> wrote:
> On Sep 24, 8:40 pm, Asun Friere <[EMAIL PROTECTED]> wrote:
> > ... I think
> > your last version ('%d thing%s' % (i, 's' if i != 1 else '')), holding
> > all variables for placeholders in the tuple, is better. It's certa
On Sep 24, 8:40 pm, Asun Friere <[EMAIL PROTECTED]> wrote:
> On Sep 25, 3:16 am, Pete Forman <[EMAIL PROTECTED]> wrote:
>
> > Asun Friere <[EMAIL PROTECTED]> writes:
>
> > > A canonical use of the conditional operator is in
> > > pluralising words, (eg. '%s dollar' % n + 's' if n!=1 else '').
>
>
On Sep 25, 3:16 am, Pete Forman <[EMAIL PROTECTED]> wrote:
> Asun Friere <[EMAIL PROTECTED]> writes:
>
> > A canonical use of the conditional operator is in
> > pluralising words, (eg. '%s dollar' % n + 's' if n!=1 else '').
>
> That fails for n == 1. So what is best?
>
Sorry missing paranthese
On Sep 25, 3:16 am, Pete Forman <[EMAIL PROTECTED]> wrote:
> Asun Friere <[EMAIL PROTECTED]> writes:
>
> > A canonical use of the conditional operator is in
> > pluralising words, (eg. '%s dollar' % n + 's' if n!=1 else '').
>
> That fails for n == 1. So what is best?
>
Sorry missing parenthese
Asun Friere <[EMAIL PROTECTED]> writes:
> A canonical use of the conditional operator is in
> pluralising words, (eg. '%s dollar' % n + 's' if n!=1 else '').
That fails for n == 1. So what is best?
for i in range(4):
print '%d thing' % i + ('s' if i != 1 else '')
for i in range(4):
p
On Sep 24, 9:52 am, Neal Becker <[EMAIL PROTECTED]> wrote:
> In hindsight, I am disappointed with the choice of conditional syntax. I
> know it's too late to change. The problem is
>
> y = some thing or other if x else something_else
>
> When scanning this my eye tends to see the first phrase an
Neal Becker a écrit :
(snip)
I find I'm often tripped up by:
x = Y (lots of constructor arguments) if something ...
on first glance, I don't notice the if.
Indeed. The inline conditionnal syntax is obviously innappropriate here.
It's just like list-comprehensions : just fine for simple
"Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote:
> You're out of options. You have to express it somehow.
How about:
Assignith z the value of x if the value of b is such that it is true, else
assignith it the value of y. Assignith z not the value of w, nor the value
of v, lest you ra
On 23 set, 22:50, Neal Becker <[EMAIL PROTECTED]> wrote:
> I find I'm often tripped up by:
>
> x = Y (lots of constructor arguments) if something ...
>
> on first glance, I don't notice the if.
Nobody does. This peculiar syntax has much better usage in short
expressions. dothis if this else
On Sep 23, 8:50 pm, Neal Becker <[EMAIL PROTECTED]> wrote:
> Aaron "Castironpi" Brady wrote:
> > On Sep 23, 6:52 pm, Neal Becker <[EMAIL PROTECTED]> wrote:
> >> In hindsight, I am disappointed with the choice of conditional syntax. I
> >> know it's too late to change. The problem is
>
> >> y = so
Aaron "Castironpi" Brady wrote:
> On Sep 23, 6:52 pm, Neal Becker <[EMAIL PROTECTED]> wrote:
>> In hindsight, I am disappointed with the choice of conditional syntax. I
>> know it's too late to change. The problem is
>>
>> y = some thing or other if x else something_else
>>
>> When scanning this
On 23 set, 20:52, Neal Becker <[EMAIL PROTECTED]> wrote:
> In hindsight, I am disappointed with the choice of conditional syntax. I
> know it's too late to change. The problem is
>
> y = some thing or other if x else something_else
>
> When scanning this my eye tends to see the first phrase and
On Sep 23, 6:52 pm, Neal Becker <[EMAIL PROTECTED]> wrote:
> In hindsight, I am disappointed with the choice of conditional syntax. I
> know it's too late to change. The problem is
>
> y = some thing or other if x else something_else
>
> When scanning this my eye tends to see the first phrase an
Cameron Simpson <[EMAIL PROTECTED]> writes:
> A good coder will present things clearly. For trivial stuff the one
> line form may be fine, and for longer stuff then this:
>
> y = some thing or other \
> if x \
> else something_else
Parentheses are usually more robust for multi-line
On 23Sep2008 19:52, Neal Becker <[EMAIL PROTECTED]> wrote:
| In hindsight, I am disappointed with the choice of conditional syntax.
| I know it's too late to change. The problem is
|
| y = some thing or other if x else something_else
|
| When scanning this my eye tends to see the first phrase an
16 matches
Mail list logo