That’s a fair question to ask about default behaviors, especially since lists can be weird in Python; setting an empty list as a default argument to a constructor is bad practice and likely to result in bugs.
So asking “why” here is a legitimate question and requires an explanation of how Python works at the C level that OP is probably not looking for, but would be different if they declared it differently.
1
u/notsaneatall_ 4d ago
It's the right way to initialize an empty list