[Python-Dev] Trinary Operators (original) (raw)

Jp Calderone exarkun@intarweb.us
Thu, 6 Feb 2003 14:47:59 -0500


--DBIVS5p969aUjpLe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable

On Thu, Feb 06, 2003 at 10:39:52AM -0800, Gary Herron wrote:

On Thursday 06 February 2003 10:08 am, Guido van Rossum wrote: [snip] =20 If this is just for fun, why stop with just "trinary"? How about one of the following (depending on ease of parsing)? These look even more like list comprehension. =20 x =3D (e1 if c1 e2 if c2 e3 if c3 ... else d) x =3D (e1 if c1 else e2 if c2 else e3 if c3 ... else d) =20 =20 I guess we'd have to call it the n-ary operator. =20

Or "conditional comprehensions"? :)

Jp

--=20 http://catandgirl.com/view.cgi?44 --=20 up 52 days, 23:50, 3 users, load average: 0.28, 0.23, 0.24

--DBIVS5p969aUjpLe Content-Type: application/pgp-signature Content-Disposition: inline

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE+QrvvedcO2BJA+4YRAglqAJ9TPwg3RqhPndKznR4hiyfa+kiK9gCgk6WV Koa6MAeQzX6YvmNfvjJAnp0= =UpiP -----END PGP SIGNATURE-----

--DBIVS5p969aUjpLe--