you could set the count as 0 in the begining of the function
def bubbleSort(arr): swap.calls = 0
and the decorator on the swap
@swapCount def swaparr): pass