3 ms·
The Python default parameter rules cause a_list=[] to share the same mutable list between all invocations of the function. That's probably not what you want. If
by LogicHoleFlaw 18y ago
The Python default parameter rules cause a_list=[] to share the same mutable list between all invocations of the function. That's probably not what you want. If you set it to the immutable None then it doesn't matter that the instance is shared.