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

Stefan Behnel tracker at bugs.pypy.org
Tue Apr 10 21:51:49 CEST 2012

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

PyUnicode_Split() is like this:

@cpython_api([PyObject, PyObject, Py_ssize_t], PyObject)
def PyUnicode_Split(space, w_str, w_sep, maxsplit):
    """Split a string giving a list of Unicode strings.  If sep is NULL, splitting
    will be done at all whitespace substrings.  Otherwise, splits occur at the given
    separator.  At most maxsplit splits will be done.  If negative, no limit is
    set.  Separators are not included in the resulting list.

    This function used an int type for maxsplit. This might require
    changes in your code for properly supporting 64-bit systems.

    return space.call_method(w_str, "split", w_sep, space.wrap(maxsplit))

(assuming that a NULL value for w_sep turns into a None object value)

title: [cpyext] missing PyUnicode_Count() -> [cpyext] missing PyUnicode_Count() and other PyUnicode_*() functions

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list