Voting for PEP 308

Andrew Koenig ark at research.att.com
Tue Feb 11 16:30:28 EST 2003


Hans> Hmm, what if bools grew an if() method?  We could then write:
Hans>
Hans>    z = (x == y).if(whentrue, whenfalse)
Hans>
Hans> This strikes me as much more elegant than the other proposals.
Hans>
Hans> (ducking for cover, etc :-)

Dan> You joke, but that's basically what Smalltalk does.

...with one crucial difference:  Smalltalk passes blocks rather than
expression values, so only one of the alternatives is really
evaluated.

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark




More information about the Python-list mailing list