Return the number of characters of the text fragment,
        not including the line separators.

        :rtype: int

def chars(self):
        """
        Return the number of characters of the text fragment,
        not including the line separators.

        :rtype: int
        """
        if self.lines is None:
            return 0
        return sum([len(line) for line in self.lines])