def foo(self, matrix_order, matrix_dict, list):
so if you call it multiple times, each time receives the exact same list
default args are only initialized once
------ Solution
def foo(self, matrix_order, matrix_dict, list=None):
if list is None:
list = [[], [], []]
No comments:
Post a Comment