News for hackers. Stuff that matters.
Re:Ask HN: What are your favorite examples of elegant software? by MisterBiggs on Tuesday May 03, 2022 @12:24AM (#31244596)
Surprised to see this works for list() as well.

  >>> def func(b, a=list()):
  ...     a.append(b)
  ...     print(a)
  ...
  >>> func(3)
  [3]
  >>> func(3)
  [3, 3]
Honestly surprised this quirk hasn't bit me yet

There are no comments on this comment yet.