PEP 308: "then" "else" for deprecating "and" "or" side effects

Michael Hudson mwh at python.net
Thu Feb 27 14:58:23 CET 2003


andrew at acooke.org (andrew cooke) writes:

> i've just read the pep (it seems to be doing the rounds in blogs) and
> haven't followed the discussion, so this might have been covered

Given the thousands of posts on this topic, how could it not have
been?

> (although searching google for tertiary and lazy on the group turned
> up nothing).

"tertiary" is a new and creatively bad search term for this topic :-)

> if using a funcion like cond(a, b, c) doesn't work because of eager
> evaluation of parameters, you might consider adding lazy evaluation to
> python.

Two comments:

1) adding lazy evaluation to Python to get a conditional operator is
   just plain bonkers

2) There's a reason for this table:

                   |no side effects| side effects  |
    ---------------+---------------+---------------+
                   | ML(ish)       | Python, C,    |
        strict     | probably some | many others   |
                   |  others       |               |
    ---------------+---------------+---------------+
        lazy       |  Haskell      | <gaping void> |
    ---------------+---------------+---------------+

Cheers,
M.

-- 
  same software, different verbosity settings (this one goes to
  eleven)                             -- the effbot on the martellibot




More information about the Python-list mailing list