pylint is usually a good indicator of bad style. Even when he gives a โfalse positiveโ, it is probably due to the fact that he is doing something against the convention. I am not an expert, but I would say that a function that has only a side effect is not optimal. Some people (like Robert Martin in Clean Code) say that all side effects are false.
I would recommend (again, I'm not an expert):
def addSeven(foo): return foo + [7] example = [3, 4, 5, 6] example = addSeven(example)
Arguments should only be input, and the output should be through the return value. As far as I know, inference arguments are bad practice.
isilanes
source share