[pypy-issue] [issue926] string concatenation using + kills PyPy

hruske tracker at bugs.pypy.org
Sun Nov 6 15:39:09 CET 2011


hruske <zejn at kiberpipa.org> added the comment:

After more debugging I found out this is a string concatenation issue, which was
done by adding strings together. This apparently kills PyPy.

Above is my modified version, below is original, of pyparsing.py:

# pyparsing.py, class ParseResults, line 446
    def __str__( self ):
        out = []
        for i in self.__toklist:
            if isinstance(i, ParseResults):
                out.append(_ustr(i))
            else:
                out.append(repr(i))
        return '[' + ', '.join(out) + ']'

        """
        out = "["
        sep = ""
        for i in self.__toklist:
            if isinstance(i, ParseResults):
                out += sep + _ustr(i)
            else:
                out += sep + repr(i)
            sep = ", "
        out += "]"
        return out
        #"""

----------
status: unread -> chatting
title: pyparsing: PyPy takes much more time than CPython -> string concatenation using + kills PyPy

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue926>
________________________________________


More information about the pypy-issue mailing list