2 ms·
Not sure if that classifies as a memory leak,but it can happen with mutable types (lists for example) attached to some global variable or as a default in a clas
by persedes 5y ago
Not sure if that classifies as a memory leak,but it can happen with mutable types (lists for example) attached to some global variable or as a default in a class definition / function input.
For example:
class A
a = []
def __init__(self):
self.a.append(1)
Or
def foo(a=[]):
# code that adds to a...