I had this problem and while the other answers provide correct explanations, the solution/workaround I liked isn't here. Using the addition operator will concatenate lists together and return the result. In my case I was bookkeeping color
as a 3-digit list and opacity
as a float, but the library needed color as a 4 digit list with opacity as the 4th digit. I didn't want to name a throwaway variable, so this syntax suited my needs:
color = [1, 1, 0]
opacity = 0.75
plot.setColor(color + [opacity])
This creates a new list for opacity on the fly and a new list after the concatenation, but that's fine for my purposes. I just wanted compact syntax for extending a list with a float and returning the resulting list without affecting the original list or float.