News for hackers. Stuff that matters.
Re:Anti-Patterns in Python Programming by calvins on Wednesday July 09, 2014 @01:47PM (#8011107)
I think only the second is truly bug-free. The first only does what the user expects if they pass in a non-empty list:

  my_list = []
  append_one(my_list)
  # my_list didn't get anything appended to it
This shows up another subtle trap related to the "truthiness" (or falsiness in this case) of things like the empty list.

There are no comments on this comment yet.