In some code I was working in, I have two lists l1, l2, and I was planning on extending l1 with l2. There are two obvious ways of doing so
l1 += l2
and
l1.extend(l2)
In my head, I always thought the first was implemented as the second, but after 100 trials on randomized lists of length 100k, I found the average time for the first to complete was 0.047 seconds, and the average time for the second was 0.043
Is my assumption correct (the first is just syntactic sugar for the second), or is there something more interesting going on here?