4 ms·
It's an obscure Python quirk that default parameters are constructed during compilation time and then never re-constructed. So, to illustrate: >>> def hello(
by shadytrees 18y ago
It's an obscure Python quirk that default parameters are constructed during compilation time and then never re-constructed. So, to illustrate:
>>> def hello(a=[]): a.append('hello'); return a;
...
>>> hello()
['hello']
>>> hello()
['hello', 'hello']
On post, what mindslight said.