def cons(self, el):
        # if there is a room in tail, just append value to tail
        if 32 < (self.length - self._tailoff()):
            tailup = self.tail[:]
            tailup.append(el)
            return self.__class__(self.length+1, self.shift, self.root, tailup)

        # if tail is already full, we need to push element into tree
        # (from the top)
        tailnode = self.__class__._Node(self.tail)

        # if root is overflowed, we need to expand the whole tree
        if (self.length >> 5) > (1 << self.shift):
            uproot = self.__class__._Node(init=self.root)
            uproot.array[1] = self.__class__._make_path(self.shift, tailnode)
            shift = self.shift + 5
        else:
            uproot = self._push_tail(self.shift, self.root, tailnode)
            shift = self.shift

        return self.__class__(self.length+1, shift, uproot, [el])
dataset/ETHPy150Open kachayev/fn.py/fn/immutable/trie.py/Vector.cons/swapped operands of `<`