logoalt Hacker News

teo_zeroyesterday at 6:55 PM1 replyview on HN

The real question is, why does Python even have parentheses? If semantic indent is superior to braces, it ought to beat parentheses, too. The following should yield 14:

  a = 2 *
    3 + 4

Replies

kazinatortoday at 12:50 AM

Also, don't forget that python has;

  list = [
    1,2,3,
    [ 4, 5 ],
    6
  ]
Without this Python would basically have to be Yaml-ish Lisp:

  =
    a
    *
      2
      +
        3
        4
Let's drop the leading Yaml dashes needed to make ordered list elements. So we have an = node (assignment) which takes an a destination, and a * expression as the source operand. *'s operands are 2 and a + node, whose operands are 3 and 4.