(self, address: int)
return None
Check if an address belongs to any segment, and if yes, returns the sort of the segment

        :param address: The address to check
        :return: Sort of the segment that occupies this address
Check if an address belongs to any segment, and if yes, returns the sort of the segment
Check if an address belongs to any segment and if yes returns the sort of the segment
def occupied_by_sort(self, address: int) -> Optional[str]:
        """
        Check if an address belongs to any segment, and if yes, returns the sort of the segment

        :param address: The address to check
        :return: Sort of the segment that occupies this address
        """

        idx = self.search(address)
        if len(self._list) <= idx:
            return None
        if self._list[idx].start <= address < self._list[idx].end:
            return self._list[idx].sort
        if idx > 0 and address < self._list[idx - 1].end:
            # TODO: It seems that this branch is never reached. Should it be removed?
            return self._list[idx - 1].sort
        return None
def occupied_by_sort ( self , address : int ) -> Optional [ str ] : idx = self . search ( address ) if len ( self . _list ) <= idx : return None if self . _list [ idx ] . start <= address < self . _list [ idx ] . end : return self . _list [ idx ] . sort if idx > 0 and address < self . _list [ idx - 1 ] . end : # TODO: It seems that this branch is never reached. Should it be removed? return self . _list [ idx - 1 ] . sort return None