308: the debate is petering out

1926 ~on-topic PEP 308 posts by 185 posters posts by day: 07 Feb 73 08 Feb 374 09 Feb 244 10 Feb 382 11 Feb 298 12 Feb 229 13 Feb 124 14 Feb 82 15 Feb 62 16 Feb 34 17 Feb 22 posters with >2 posts: Erik Max Francis 254 Andrew Koenig 156 Andrew Dalke 99 => ~1/4 posts (509) by 3 poster(s) Aahz 84 holger krekel 72 Paul Rubin 56 Bengt Richter 53 James J. Besemer 51 Christian Tismer 43 Samuele Pedroni 43 Terry Reedy 43 Laura Creighton 38 => ~1/2 posts (992) by 12 poster(s) Dave Brueck 36 Michele Simionato 33 Tim Peters 31 Paul Moore 30 Roy Smith 30 Carlos Ribeiro 28 David Eppstein 28 Paul Paterson 23 Alex Martelli 21 Michael Hudson 21 ...

Aahz, is it time to start collecting the votes yet? Raymond, have any new proposals been suggested and not shot down? Somebody mentioned usability studies. Did anything come out of that? --Guido van Rossum (home page: http://www.python.org/~guido/)

On Tue, Feb 18, 2003, Guido van Rossum wrote:
Aahz, is it time to start collecting the votes yet?
Maybe, but I've been too sick of the discussion to read it for the past three days, and I'm leaving today for the fifth anniversary of my outlaw wedding. I'll be back Friday. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ Register for PyCon now! http://www.python.org/pycon/reg.html

Raymond, have any new proposals been suggested and not shot down?
I've been away from the keyboard for three days and will need this evening to get caught-up on all the posts. If something new and wonderful came-up, I'll update the PEP.
Somebody mentioned usability studies. Did anything come out of that?
Yes. A bunch of people tried out the various forms on children, significant others, and employees. * In general, all of the forms were decipherable by people who already knew Python. * The c?a:b form was understandable to people familiar with other languages. With a single example, others were able to understand the form and found it easy to use. The surprise was that the n-ary form (using parens for sub-expressions) managed to confuse even non-beginners. The best guess at the cause is that the grouping and precedence cues for parentheses do not mix well with the concepts of grouping by ternary operator and of short-circuit evaluation. * The (if c: a else: b) form stumped some of the victims. In some experiments, this was especially surprising because they had just seen one of the other forms and had some expectation of what it was supposed to do. The root problem appears to be the blurring of the line between statements and expressions where the keyword and colon cues proved misleading. On the plus side, everyone who understood the ternary version had no problem with the n-ary version. * The c then a else b form was understood by most though a few thought it looked unnatural in longer expressions. There were some who understood it but could not make the jump to the n-ary form (using the elif keyword). It appears that the colons help to visually parse the n-ary form. Raymond Hettinger

Raymond, have any new proposals been suggested and not shot down?
Someone re-proposed c ? a else b. Their rationale is that the ? is a better marker than "then" and is suggestive enough to not need a leading "if"; it doesn't require a new keyword and does not overload the colon. No one shot this down but it didn't generate any real support either. There was an interesting, weird, and fruitless discussion on how "c then a else b" could be implemented as a pair of binary operators that are not required to be used together. There was a rapidly shot down idea to use bool.choose(a, b) where choose() was a special method that could somehow implement lazy evaluation of its arguments. A recent proposal is: (? <cond1>: <expr1>, <cond2>: <expr2>, <default> ?). There have only been a few hours for comment. Though the visual cues are there, my issue with it is that the colon usage is likely to confuse anyone exposed to the c?a:b form in other languages where the colon separates the alteratives rather than the condition and alternative. Raymond Hettinger

There were a group of people that would find a when C else B with 'when' instead of 'if' less confusing than 'a if C else b'. The alternative (as in Haskell, ML,...): if C then a else b was also mentioned a few times. For the rest I think we have all reasonable contenders. ----- Original Message ----- From: "Raymond Hettinger" <python@rcn.com> To: "Guido van Rossum" <guido@python.org>; <python-dev@python.org> Sent: Wednesday, February 19, 2003 2:40 AM Subject: Re: [Python-Dev] 308: the debate is petering out
Raymond, have any new proposals been suggested and not shot down?
Someone re-proposed c ? a else b. Their rationale is that the ? is a better marker than "then" and is suggestive enough to not need a leading "if"; it doesn't require a new keyword and does not overload the colon. No one shot this down but it didn't generate any real support either.
There was an interesting, weird, and fruitless discussion on how "c then a else b" could be implemented as a pair of binary operators that are not required to be used together.
There was a rapidly shot down idea to use bool.choose(a, b) where choose() was a special method that could somehow implement lazy evaluation of its arguments.
A recent proposal is: (? <cond1>: <expr1>, <cond2>: <expr2>, <default> ?). There have only been a few hours for comment. Though the visual cues are there, my issue with it is that the colon usage is likely to confuse anyone exposed to the c?a:b form in other languages where the colon separates the alteratives rather than the condition and alternative.
Raymond Hettinger
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev
participants (4)
-
Aahz
-
Guido van Rossum
-
Raymond Hettinger
-
Samuele Pedroni