Blog


Python Default Parameter Gotcha

  • September 8, 2019
  • Python

Take a look at this code. All it does is return a list with appended parameter. In case no list is supplied, it defaults to an empty list and appends to it. Or is it???

Look at the second result. We expected [“silver”] expecting the item to be appended to an empty list as […]