Hacker News new | ask | show | jobs
by MisterBiggs 1502 days ago
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