Change default `durations` argument from list in `generate.py`
Just leaving here so I don't forget, happy to make a PR on this. Some of the default arguments for functions in generate.py are mutable, which is not reccomended due to pythons crazy behaviour. These could be changed to None and the default value set in the body of the function.
Yeah, I noticed that too recently. This is a common mistake that people make in Python. Altought we don't really mutate those lists is would be a good practice to change it. A good heuristic to remember this is that default values are values (not expressions).
I made one for the other instances of this pattern in #2345.
This discussion came up again:
https://github.com/SpikeInterface/spikeinterface/pull/2777
@alejoe91 really wanted to move forward with this, @samuelgarcia supported the idea of using tuples or copying the list at the beginning of the function.