Grant Edwards wrote:
On 2009-10-11, metal <metal...@gmail.com> wrote:

I wonder the reason for ELIF. it's not aligned with IF, make code ugly

It most certainly is aligned with IF:


  if cond1:
      do this
  elif cond2:
      do that
  else:
      do the other

The "if" "elif" and "else" are all aligned in all of the code
I've ever seen.

In some other languages, eg Modula-2, it's 'elsif'; the disadvantage
there is that if you were hearing it read out you might ask:

    Do you mean 'elsif' or 'else if'?

so 'elif' is not only shorter, it's clearer.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to