Suppose I have the following list:
a = ["hello",
"hi",
"bye"]
I move the elements around, and, by mistake, I end up with:
a = ["hello",
"bye"
"hi"]
which is a list of 2 elements: "hello" and "byehi".
How can I have Python detect this mistake?
Currently I ended up with:
assert(len(a)==3)
which of course requires update whenever I add an element to the list.
How to decrease the possibility of this mistake (of course other than being careful)?
Is there some other separator for lists that won't merge strings that way, for example?
Is there a linter or an external tool that can detect that?