*blink* That's neat.

Andrew Dalke dalke at acm.org
Wed May 31 22:48:21 EDT 2000


Niels Diepeveen wrote:
>Doing without "or" gets messy if you don't have "goto". Nested if-elses
>with a single boolean operator is probably something most people can
>deal with.

You can write "if a or b" easily if function definitions are allowed:

def or(a, b):
  if a:
    return a  # or 1
  if b:
    return b
  return 0

A least this makes the goto implicit.

                    Andrew
                    dalke at acm.org






More information about the Python-list mailing list