The original problem i am dealing with is outlined here. I would like to ask an additional question (about Python reference counting) related to the original problem.
Lets say that i have the following script:
from bitarray import bitarray
from array import array
list1=[bitarray('00011'), bitarray('00010'), bitarray('11011')]
list2=[array('i',[0,0,0,0]),array('i',[1,1,1,1]),array('i',[2,2,2,2])]
def calculate(l1,l2):
result1=l1[0]&l1[1]&l1[2]
result2=l2[0][0]+l2[1][1]+l2[2][2]
return result1, result2
print calculate(list1,list2)
Does the reference count of list1
, list2
or any of the objects in either lists changes at some point when i call calculate(list1,list2)
?
Just to clarify: I do not mean if the reference count will be the same before and after calling calculate(list1,list2)
. I mean if the reference count changes at any point during the execution of calculate(list1,list2)
.