(self, pwcs, n=None)
return width
A wcswidth that never gives -1. Copying existing code is evil, but..

        github.com/jquast/wcwidth/blob/07cea7f/wcwidth/wcwidth.py#L182-L204
A wcswidth that never gives -1. Copying existing code is evil, but..
A wcswidth that never gives - 1 . Copying existing code is evil but ..
def _disp_width(self, pwcs, n=None):
        """
        A wcswidth that never gives -1. Copying existing code is evil, but..

        github.com/jquast/wcwidth/blob/07cea7f/wcwidth/wcwidth.py#L182-L204
        """
        # pylint: disable=C0103
        #         Invalid argument name "n"
        # TODO: Shall we consider things like ANSI escape seqs here?
        #       We can implement some ignore-me segment like those wrapped by
        #       \1 and \2 in readline too.
        end = len(pwcs) if n is None else n
        idx = slice(0, end)
        width = 0
        for char in pwcs[idx]:
            width += max(0, wcwidth(char))
        return width
def _disp_width ( self , pwcs , n = None ) : # pylint: disable=C0103 #         Invalid argument name "n" # TODO: Shall we consider things like ANSI escape seqs here? #       We can implement some ignore-me segment like those wrapped by #       \1 and \2 in readline too. end = len ( pwcs ) if n is None else n idx = slice ( 0 , end ) width = 0 for char in pwcs [ idx ] : width += max ( 0 , wcwidth ( char ) ) return width