Skip to content

Comment on Stupid Languagesparent

Comments

You essentially changed the definition of "value" to mean what is just called "name" in Python.

Names refer to objects. Names are introduced by name binding operations such as `=`, `import`, `def`.

  def f(a, b):  # a, b - local variables
       a = [1]  # doesn't change  x list; a refers to the new list hence forth
       b.append(2)  # change y list; b refers to the same list as y

  x, y = [], []
  f(x, y)
  print x, y  # [], [2]
Note: a "win" doesn't change the truth. It just means that nobody cared enough to participate further in the hostile discussion.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.