3 ms·
Actually, the explanation doesn't explain it all. In Python, variables are references (pointers). `[]` gets evaluated on import time, and returns a pointer to
by hcarvalhoalves 12y ago
Actually, the explanation doesn't explain it all.
In Python, variables are references (pointers). `[]` gets evaluated on import time, and returns a pointer to an object (an empty list). This object is then further mutated on the body on the next calls because if you don't pass the parameter, it still points to the same object.