News for hackers. Stuff that matters.
Re:SICP in Python by kazinator on Wednesday April 29, 2020 @03:21PM (#23023051)
> the default value does not have to be a literal value

The default isn't a literal value when it is [], by the way.

If [] were a literal, then this would not be safe or correct:

   def fun():
     local = []
     local.append(3)
The fact is that whenever [] is evaluated, it produces a fresh list each time. It's a constructor for an empty list, exactly like set() for an empty set. It just has slicker syntactic sugar.

Python just calls that a literal because it looks like one.

Looking is being, in Python. Except for all the pitfalls.

There are no comments on this comment yet.