getnikola/nikola — pull request #1532 by magmax (2014-12-13 17:31:38+00:00)
Title: Avoiding memory leaks

In python it is very common to use default values in method arguments. But you should not use list or dicts there.

The problem is that the argument is initialized with the list/dict address, so it can happen unexpected results:

```python
>>> def f(a=[]):
a.append(1)
print(a)

>>> f()
[1]

>>> f()
[1, 1]

>>> f()
[1, 1, 1]
```
Usually this problem generates a memory leak, because you can have a never-ending array; often, it slows down the program performance, processing items more than once.

Even if this is the expected result, it is too difficult to the reader to identify it. So, please, avoid using them as arguments.