[Python-Dev] What happened to Guido's plans for (S1; S2; ...; Sn; E) ?

John Roth johnroth at ameritech.net
Tue Oct 16 16:14:46 EDT 2001


Interesting proposal - I wasn't here at the time.

It certainly seems to address part of the 'loop and a half'
issue, possibly all of it.

I assume it needs a PEP now.

John Roth

"Hamish Lawson" <hamish_lawson at yahoo.co.uk> wrote in message
news:mailman.1003254316.27556.python-list at python.org...
> The current discussion on conditional expressions has at times touched
> on the ever-recurring issue of assignment in expressions. It reminded
> me that a proposal by Kevin Digweed back in early 1999 had actually
> managed to obtain Guido's approval as a reasonably Pythonic approach to
> allowing assignment in expressions, and the proposal seemed intended to
> make its eventual way into Python. Is this still the case?
>
> Kevin's original proposal:
>
> | What about allowing an optional "assignment only" suite
> | between "while" and the test condition. This suite will be executed
> | before testing the condition each time
> |
>
<http://groups.google.com/groups?hl=en&selm=78naok%242ed%241%40nnrp1.dejanew
s.com>
>
> Guido then expanded on the proposal and seemed to give it his approval:
>
> | Why stop there?  It could easily be any number of "small" statements
> | separated by semicolons with the restriction that the final one must
> | be an expression and that the ones before it must not be flow-control
> | statements (return, raise, continue, break).  Other useful statements
> | to allow are print (for debugging) and assert, and for all I care
> | import, del, pass, and exec.
> |
> | Note that I like this for 2.0, not so much for for 1.6 (if only
> | because I don't want 1.6 to make existing books obsolete).
> |
>
<http://groups.google.com/groups?hl=en&selm=199902021501.KAA07333%40eric.cnr
i.reston.va.us>
>
> Guido also clarified its intended syntax and semantics:
>
> | In my interpretation, the expression (S1; S2; ...; Sn; E) yields the
> | value of expression E -- S1-Sn are only there for their side effects.
> |
>
<http://groups.google.com/groups?hl=en&selm=199902031343.IAA09480%40eric.cnr
i.reston.va.us>
>
>
> Hamish Lawson
>
>
> ____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
>





More information about the Python-list mailing list