This code below is what I think should be the implementation of merge sort in Python and it works as expected. It sorts the given list, where we can safely assume that all values are distinct. But after considering some online implementations I am doubtful about mine. So the base question is "Is this even Merge sort?".
def merge(arr): # base case length = len(arr) half = length//2 if length == 1 or length == 0: return arr # recursive case firstHalf = merge(arr[:half]) # sort first half secondHalf = merge(arr[half:]) # sort second half length_firstHalf = len(firstHalf) length_secondHalf = len(secondHalf) sortedList =  i, j = 0, 0 # variables for iteration while i != length_firstHalf and j != length_secondHalf: # add elements into the new array until either of then two sub arrays is completely traversed if firstHalf[i] > secondHalf[j]: sortedList.append(secondHalf[j]) j += 1 continue if firstHalf[i] < secondHalf[j]: sortedList.append(firstHalf[i]) i += 1 return(sortedList + firstHalf[i:] + secondHalf[j:]) # return the array after adding whats left of sub array which wasnt completely traversed