[pypy-issue] [issue1120] [cpyext] missing PyUnicode_Count() and other PyUnicode_*() functions

Stefan Behnel tracker at bugs.pypy.org
Tue Apr 10 21:57:14 CEST 2012


Stefan Behnel <stefan_ml at behnel.de> added the comment:

And another straight forward one is PyUnicode_Splitlines(), which goes like this:

@cpython_api([PyObject, rffi.INT_real], PyObject)
def PyUnicode_Splitlines(space, w_str, keepend):
    """Split a Unicode string at line breaks, returning a list of Unicode strings.
    CRLF is considered to be one line break.  If keepend is 0, the Line break
    characters are not included in the resulting strings.
    """

    return space.call_method(w_str, "splitlines", space.wrap(bool(keepend)))

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


More information about the pypy-issue mailing list