Commit 8e29c86c authored by Stefan Behnel's avatar Stefan Behnel

tighten return type declarations of some C-API functions

parent cfbd88a2
...@@ -25,7 +25,7 @@ cdef extern from "Python.h": ...@@ -25,7 +25,7 @@ cdef extern from "Python.h":
# Return true if p is a dict object, but not an instance of a # Return true if p is a dict object, but not an instance of a
# subtype of the dict type. # subtype of the dict type.
object PyDict_New() dict PyDict_New()
# Return value: New reference. # Return value: New reference.
# Return a new empty dictionary, or NULL on failure. # Return a new empty dictionary, or NULL on failure.
...@@ -43,7 +43,7 @@ cdef extern from "Python.h": ...@@ -43,7 +43,7 @@ cdef extern from "Python.h":
# matches key, return 1, otherwise return 0. On error, return # matches key, return 1, otherwise return 0. On error, return
# -1. This is equivalent to the Python expression "key in p". # -1. This is equivalent to the Python expression "key in p".
object PyDict_Copy(object p) dict PyDict_Copy(object p)
# Return value: New reference. # Return value: New reference.
# Return a new dictionary that contains the same key-value pairs as p. # Return a new dictionary that contains the same key-value pairs as p.
...@@ -77,19 +77,19 @@ cdef extern from "Python.h": ...@@ -77,19 +77,19 @@ cdef extern from "Python.h":
# This is the same as PyDict_GetItem(), but key is specified as a # This is the same as PyDict_GetItem(), but key is specified as a
# char*, rather than a PyObject*. # char*, rather than a PyObject*.
object PyDict_Items(object p) list PyDict_Items(object p)
# Return value: New reference. # Return value: New reference.
# Return a PyListObject containing all the items from the # Return a PyListObject containing all the items from the
# dictionary, as in the dictionary method items() (see the Python # dictionary, as in the dictionary method items() (see the Python
# Library Reference). # Library Reference).
object PyDict_Keys(object p) list PyDict_Keys(object p)
# Return value: New reference. # Return value: New reference.
# Return a PyListObject containing all the keys from the # Return a PyListObject containing all the keys from the
# dictionary, as in the dictionary method keys() (see the Python # dictionary, as in the dictionary method keys() (see the Python
# Library Reference). # Library Reference).
object PyDict_Values(object p) list PyDict_Values(object p)
# Return value: New reference. # Return value: New reference.
# Return a PyListObject containing all the values from the # Return a PyListObject containing all the values from the
# dictionary p, as in the dictionary method values() (see the # dictionary p, as in the dictionary method values() (see the
......
...@@ -5,7 +5,7 @@ cdef extern from "Python.h": ...@@ -5,7 +5,7 @@ cdef extern from "Python.h":
############################################################################ ############################################################################
# Lists # Lists
############################################################################ ############################################################################
object PyList_New(Py_ssize_t len) list PyList_New(Py_ssize_t len)
# Return a new list of length len on success, or NULL on failure. # Return a new list of length len on success, or NULL on failure.
# #
# Note: If length is greater than zero, the returned list object's # Note: If length is greater than zero, the returned list object's
...@@ -64,7 +64,7 @@ cdef extern from "Python.h": ...@@ -64,7 +64,7 @@ cdef extern from "Python.h":
# successful; return -1 and set an exception if # successful; return -1 and set an exception if
# unsuccessful. Analogous to list.append(item). # unsuccessful. Analogous to list.append(item).
object PyList_GetSlice(object list, Py_ssize_t low, Py_ssize_t high) list PyList_GetSlice(object list, Py_ssize_t low, Py_ssize_t high)
# Return value: New reference. # Return value: New reference.
# Return a list of the objects in list containing the objects # Return a list of the objects in list containing the objects
# between low and high. Return NULL and set an exception if # between low and high. Return NULL and set an exception if
...@@ -84,7 +84,7 @@ cdef extern from "Python.h": ...@@ -84,7 +84,7 @@ cdef extern from "Python.h":
# Reverse the items of list in place. Return 0 on success, -1 on # Reverse the items of list in place. Return 0 on success, -1 on
# failure. This is the equivalent of "list.reverse()". # failure. This is the equivalent of "list.reverse()".
object PyList_AsTuple(object list) tuple PyList_AsTuple(object list)
# Return value: New reference. # Return value: New reference.
# Return a new tuple object containing the contents of list; # Return a new tuple object containing the contents of list;
# equivalent to "tuple(list)". # equivalent to "tuple(list)".
......
...@@ -87,14 +87,14 @@ cdef extern from *: ...@@ -87,14 +87,14 @@ cdef extern from *:
# not NULL, the return value might be a shared object. Therefore, # not NULL, the return value might be a shared object. Therefore,
# modification of the resulting Unicode object is only allowed # modification of the resulting Unicode object is only allowed
# when u is NULL. # when u is NULL.
object PyUnicode_FromUnicode(Py_UNICODE *u, Py_ssize_t size) unicode PyUnicode_FromUnicode(Py_UNICODE *u, Py_ssize_t size)
# Create a Unicode Object from the given Unicode code point ordinal. # Create a Unicode Object from the given Unicode code point ordinal.
# #
# The ordinal must be in range(0x10000) on narrow Python builds # The ordinal must be in range(0x10000) on narrow Python builds
# (UCS2), and range(0x110000) on wide builds (UCS4). A ValueError # (UCS2), and range(0x110000) on wide builds (UCS4). A ValueError
# is raised in case it is not. # is raised in case it is not.
object PyUnicode_FromOrdinal(int ordinal) unicode PyUnicode_FromOrdinal(int ordinal)
# Return a read-only pointer to the Unicode object's internal # Return a read-only pointer to the Unicode object's internal
# Py_UNICODE buffer, NULL if unicode is not a Unicode object. # Py_UNICODE buffer, NULL if unicode is not a Unicode object.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment