First I created two results of a & b by using heapq.merge
, but after merge
ing a&b, I found the list of a is empty.
>>> a=merge([1,2],[3,4])
>>> b=merge([4,5],[6,7])
>>> list(a)
[1, 2, 3, 4]
>>> merge(a,b)
<generator object merge at 0x365c370>
>>> list(a)
[]
>>>
The final result of list(a)
is empty, why does merge(a,b)
change a?