Peter Hansen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Dave Hansen wrote:
So lose the if.
R = C then A else B
I think that part of the argument for the A if C else B syntax is that
then is not currently a reserved word.
--
On Wed, 12 Oct 2005 02:15:40 -0400, Chris Smith [EMAIL PROTECTED] wrote:
Sebastian == Sebastian Bassi [EMAIL PROTECTED] writes:
Sebastian On 9/30/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote:
after Guido's pronouncement yesterday, in one of the next
versions of Python there
[EMAIL PROTECTED] (Dave Hansen) (DH) wrote:
DH So lose the if.
DHR = C then A else B
DH I don't think python uses the question mark for anything. Throw that
DH in, if it makes parsing easier:
DHR = C ? then A else B
We have already had this discussion several times. I don't think it
On Thu, 13 Oct 2005 21:49:15 +0200, Piet van Oostrum [EMAIL PROTECTED]
wrote:
[EMAIL PROTECTED] (Dave Hansen) (DH) wrote:
DH So lose the if.
DHR = C then A else B
DH I don't think python uses the question mark for anything. Throw that
DH in, if it makes parsing easier:
DHR = C ?
Duncan == Duncan Booth [EMAIL PROTECTED] writes:
Duncan Chris Smith wrote:
What I really want to do is take four lines of conditional, and
put them into one, as well as blow off dealing with a 'filler'
variable:
return the answer is + yes if X==0 else no
Sebastian == Sebastian Bassi [EMAIL PROTECTED] writes:
Sebastian On 9/30/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote:
after Guido's pronouncement yesterday, in one of the next
versions of Python there will be a conditional expression with
the following syntax: X if C else
On Tue, 11 Oct 2005 01:06:30 -0400, George Sakkis
[EMAIL PROTECTED] wrote:
Dave Hansen [EMAIL PROTECTED] wrote:
On Mon, 10 Oct 2005 16:42:34 -0500, Terry Hancock
[EMAIL PROTECTED] wrote:
On Sunday 09 October 2005 07:50 am, phil hunt wrote:
On Fri, 7 Oct 2005 01:05:12 -0500, Terry Hancock
On Wed, 12 Oct 2005 13:02:20 +0200, Piet van Oostrum [EMAIL PROTECTED]
wrote:
Paul Rubin http://[EMAIL PROTECTED] (PR) wrote:
[...]
PR Yeah, if C then A else B is a ancient tradition stretching from
PR Algol-60 to OCAML, and who knows what all else in between. I'm not
PR sure what Guido saw
Chris Smith [EMAIL PROTECTED] wrote:
What I really want to do is take four lines of conditional, and put
them into one, as well as blow off dealing with a 'filler' variable:
return the answer is + yes if X==0 else no
I would write this as:
return the answer is + (yes if X==0 else no)
Adding
Dave Hansen wrote:
So lose the if.
R = C then A else B
It would be nice (in my opinion) if this were the way it was going to
be. Having one of the two results come first makes that result seem
somehow of primary importance, while the conditional (which in my mind
is far more important
Dave Hansen wrote:
And Basic, and Fortran, and Lisp, and just about any programming
language you care to name, including python (if Condition: Affirmative
else: Negative).
Not to mention that the sequence is identical to execution order.
It's just plain goofy to have to scan to the middle of
Op 2005-10-10, Terry Hancock schreef [EMAIL PROTECTED]:
On Sunday 09 October 2005 07:50 am, phil hunt wrote:
On Fri, 7 Oct 2005 01:05:12 -0500, Terry Hancock [EMAIL PROTECTED] wrote:
GvR's syntax has the advantage of making grammatical sense in English (i.e.
reading it as written pretty much
Paul Rubin http://[EMAIL PROTECTED] wrote:
Reinhold Birkenfeld [EMAIL PROTECTED] writes:
For a conditional, syntax must be found, and the tradition of Python
design is not to use punctuation for something that can be solved
with keywords.
Yeah, if C then A else B is a ancient tradition
On Sunday 09 October 2005 07:50 am, phil hunt wrote:
On Fri, 7 Oct 2005 01:05:12 -0500, Terry Hancock [EMAIL PROTECTED] wrote:
GvR's syntax has the advantage of making grammatical sense in English (i.e.
reading it as written pretty much makes sense).
I know, let's re-write Python to make it
On Mon, 10 Oct 2005 16:42:34 -0500, Terry Hancock
[EMAIL PROTECTED] wrote:
On Sunday 09 October 2005 07:50 am, phil hunt wrote:
On Fri, 7 Oct 2005 01:05:12 -0500, Terry Hancock [EMAIL PROTECTED] wrote:
GvR's syntax has the advantage of making grammatical sense in English (i.e.
reading it as
On 9/30/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote:
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
I don't understand why there is a new expression, if this could be
accomplished
Sebastian Bassi wrote:
I don't understand why there is a new expression, if this could be
accomplished with:
if C:
X
else:
Y
What is the advantage with the new expression?
It actually is an expression, whereas your example shows a statement (so
this could _not_ be accomplished with
Dave Hansen [EMAIL PROTECTED] wrote:
On Mon, 10 Oct 2005 16:42:34 -0500, Terry Hancock
[EMAIL PROTECTED] wrote:
On Sunday 09 October 2005 07:50 am, phil hunt wrote:
On Fri, 7 Oct 2005 01:05:12 -0500, Terry Hancock [EMAIL PROTECTED] wrote:
GvR's syntax has the advantage of making
On Fri, 7 Oct 2005 01:05:12 -0500, Terry Hancock [EMAIL PROTECTED] wrote:
GvR's syntax has the advantage of making grammatical sense in English (i.e.
reading it as written pretty much makes sense).
I know, let's re-write Python to make it more like COBOL! That's
bound to be a winner!
--
On Monday 03 October 2005 03:48 am, Volker Grabsch wrote:
Fredrik Lundh wrote:
/... snip comment that the natural order is C, X, Y and that programmers
that
care about readable code will probably want to be extremely careful with
this
new feature .../
That's also my opinion, but
As mentioned earlier only a dictator can make such decisions and of course as
with many dictatorships the wrong decision is often made. There's no such thing
as a benevolent dictatorship.
--
Robin Becker
--
http://mail.python.org/mailman/listinfo/python-list
Robin Becker wrote:
As mentioned earlier only a dictator can make such decisions and of
course as
with many dictatorships the wrong decision is often made. There's no
such thing
as a benevolent dictatorship.
Ever cared to check what committees can do to a language ;-)
--eric
--
On Friday 07 October 2005 08:56, Eric Nieuwland wrote:
Ever cared to check what committees can do to a language ;-)
*has nasty visions of Java*
Hey! Stop that!
- Michael
--
http://mail.python.org/mailman/listinfo/python-list
On 07/10/05, Eric Nieuwland [EMAIL PROTECTED] wrote:
Ever cared to check what committees can do to a language ;-)
+1 QOTW.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
Terry Hancock wrote:
GvR's syntax has the advantage of making grammatical sense in English (i.e.
reading it as written pretty much makes sense).
as a native Python speaker, I find that argument being remarkably weak. things
I write in Python should make sense in Python, not in some other
Eric Nieuwland wrote:
Ever cared to check what committees can do to a language ;-)
well there goes democracy :(
-the happy slaves eat and are contented-ly yrs-
Robin Becker
--
http://mail.python.org/mailman/listinfo/python-list
On Friday 07 October 2005 10:52 am, Fredrik Lundh wrote:
Terry Hancock wrote:
GvR's syntax has the advantage of making grammatical sense in English (i.e.
reading it as written pretty much makes sense).
as a native Python speaker, I find that argument being remarkably weak.
things
I
On Fri, 07 Oct 2005 18:24:28 +0100, Robin Becker wrote:
Eric Nieuwland wrote:
Ever cared to check what committees can do to a language ;-)
well there goes democracy :(
For fans of Terry Pratchett's Discworld series, there is:
Vimes had once discussed the Ephebian idea of
Op 2005-09-30, Sam schreef [EMAIL PROTECTED]:
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message
Michael a écrit :
Rocco Moretti wrote:
That is, what would happen with the following constructs:
A if B else C if D else F
A if B if C else D else F
The correct answer should be the person who wrote it would get told off
for writing code that a person reading would have no idea what
Ron Adam [EMAIL PROTECTED] wrote:
So ...
A if B else C + X * Y
Would evaluate as... ?
A if B else (C + X * Y)
In general, 'if' and 'else' bind less tight than everything except
lambda.
http://mail.python.org/pipermail/python-dev/2005-September/056846.html
--
\S -- [EMAIL PROTECTED]
Christophe wrote:
Michael a écrit :
Rocco Moretti wrote:
That is, what would happen with the following constructs:
A if B else C if D else F
A if B if C else D else F
The correct answer should be the person who wrote it would get told off
for writing code that a person reading would
Paul Rubin wrote:
I'm not
sure what Guido saw in the A if C else B syntax but it's not a big deal.
Maybe Guido's done some perl programming on the side? When I've been doing
perl programming I've quite liked the if (...); construct, however, on
occasion it's been desirable to have an else
Ron Adam wrote:
It will be
A if B else (C if D else F)
So this evaluates as if there are parentheses around each section.. Hmm?
(A) if (B) else ( (C) if (D) else (F) )
The first 'if' divided the expr, then each succeeding 'if' divides the
sub expressions, etc... ?
So ...
Erik Max Francis wrote:
Dave Benjamin wrote:
Hooray! After years of arguing over which syntax to use, and finally
giving up since nobody could agree, the Benevolent Dictator did what
only a dictator can do, and just made a damn decision already.
Thank you, Guido! =)
Yes, hear hear.
Sam wrote:
Jaime Wyant writes:
On 9/30/05, Sam [EMAIL PROTECTED] wrote:
Reinhold Birkenfeld writes:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of
Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the
Reinhold Birkenfeld [EMAIL PROTECTED] writes:
For a conditional, syntax must be found, and the tradition of Python
design is not to use punctuation for something that can be solved with
keywords.
Yeah, if C then A else B is a ancient tradition stretching from
Algol-60 to OCAML, and who knows
Sam wrote:
And foo if bar is Perl-ish; yet, even Perl has the ? : operators.
What _isn't_ Perl-ish?
--
http://mail.python.org/mailman/listinfo/python-list
Leif K-Brooks writes:
Sam wrote:
And foo if bar is Perl-ish; yet, even Perl has the ? : operators.
What _isn't_ Perl-ish?
BASIC?
pgp7WNg5zZz7a.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
Ron Adam
I think I'm going to make it a habit to put parentheses around these
things just as if they were required.
Yes, that's the best way to make it readable and understandable.
Reinhold
Now that the syntax is settled, I wonder if further discussion on the
On Fri, 30 Sep 2005 21:28:26 -0400
Terry Reedy wrote:
The lesson for me is to spend much less time on Python discussion and much
more on unfinished projects. So even if I never use the new syntax, I will
have gained something ;-)
QOTW?
--
jk
--
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the same as today's
(Y, X)[bool(C)]
or
C and X or Y (only if X is True)
Reinhold
--
Reinhold Birkenfeld wrote:
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the same as today's
(Y, X)[bool(C)]
hopefully, only one of Y or X is actually evaluated ?
C
[Fredrik]
X if C else Y
hopefully, only one of Y or X is actually evaluated ?
Yes. From Guido's announcement at
http://mail.python.org/pipermail/python-dev/2005-September/056846.html:
The syntax will be
A if C else B
This first evaluates C; if it is true, A is evaluated to give
Richie Hindle [EMAIL PROTECTED] writes:
Yes. From Guido's announcement at
http://mail.python.org/pipermail/python-dev/2005-September/056846.html:
The syntax will be
A if C else B
Wow, I thought this was a prank at first. Congratulations to Guido.
I think the introduction of list and
Fredrik Lundh wrote:
Reinhold Birkenfeld wrote:
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the same as today's
(Y, X)[bool(C)]
hopefully, only one of Y or X is
Reinhold Birkenfeld wrote:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
Any word on chaining?
That is, what would happen with the following constructs:
A if B else C if D
Reinhold Birkenfeld wrote:
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
Hooray! After years of arguing over which syntax to use, and finally
giving up since nobody could agree,
Rocco Moretti wrote:
Reinhold Birkenfeld wrote:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
Any word on chaining?
That is, what would happen with the following
Dave Benjamin wrote:
Hooray! After years of arguing over which syntax to use, and finally
giving up since nobody could agree, the Benevolent Dictator did what
only a dictator can do, and just made a damn decision already.
Thank you, Guido! =)
Yes, hear hear.
So what made him change his
Reinhold Birkenfeld writes:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the same as today's
(Y, X)[bool(C)]
What's wrong with C ? X:Y?
Aside from : being
Reinhold Birkenfeld wrote:
Rocco Moretti wrote:
Reinhold Birkenfeld wrote:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
Any word on chaining?
That is, what would happen with
On 9/30/05, Sam [EMAIL PROTECTED] wrote:
Reinhold Birkenfeld writes:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the same as today's
(Y, X)[bool(C)]
On Fri, 30 Sep 2005 20:25:35 +0200, Reinhold Birkenfeld [EMAIL PROTECTED]
wrote:
Fredrik Lundh wrote:
Reinhold Birkenfeld wrote:
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
Dave Benjamin [EMAIL PROTECTED]
Hooray! After years of arguing over which syntax to use, and finally
giving up since nobody could agree,
I understand that this has become the local 'politically correct' view, but
as a participant in the discussion, I know it not true and actively
deceptive.
Jaime Wyant writes:
On 9/30/05, Sam [EMAIL PROTECTED] wrote:
Reinhold Birkenfeld writes:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the same as today's
(Y,
56 matches
Mail list logo