Open mdraw opened 8 years ago
There are multiple cases in knossos_utils/chunky.py where (mutable) lists are used as default arguments for functions.
Especially https://github.com/knossos-project/knossos_python_tools/blob/81940efc425e55b71aa37ee7b5054f08e590a38f/knossos_utils/chunky.py#L222 could cause potential bugs because of the way list_of_coords is used.
See http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments for info on why this can be problematic.
I am opening this as an issue and not just fixing it because changing the default arguments would potentially break external code using chunky.
Other occurences of lists as default arguments are in
There are multiple cases in knossos_utils/chunky.py where (mutable) lists are used as default arguments for functions.
Especially https://github.com/knossos-project/knossos_python_tools/blob/81940efc425e55b71aa37ee7b5054f08e590a38f/knossos_utils/chunky.py#L222 could cause potential bugs because of the way list_of_coords is used.
See http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments for info on why this can be problematic.
I am opening this as an issue and not just fixing it because changing the default arguments would potentially break external code using chunky.
Other occurences of lists as default arguments are in