]> granicus.if.org Git - python/commitdiff
Corrected return type and value information for PyUnicode_Count() and
authorFred Drake <fdrake@acm.org>
Thu, 20 Jun 2002 22:07:04 +0000 (22:07 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 20 Jun 2002 22:07:04 +0000 (22:07 +0000)
PyUnicode_Find().
This closes SF bug #566631.

Doc/api/concrete.tex
Doc/api/refcounts.dat

index 2face2066ab8f971b06e6fcc2fc814d6a557cffa..bf4456a69b9dccc1a884b80bf4a0ae3cf094cc67 100644 (file)
@@ -1325,23 +1325,27 @@ They all return \NULL{} or \code{-1} if an exception occurs.
   match, \var{direction} == 1 a suffix match), 0 otherwise.
 \end{cfuncdesc}
 
-\begin{cfuncdesc}{PyObject*}{PyUnicode_Find}{PyObject *str,
-                                                  PyObject *substr,
-                                                  int start,
-                                                  int end,
-                                                  int direction}
+\begin{cfuncdesc}{int}{PyUnicode_Find}{PyObject *str,
+                                       PyObject *substr,
+                                       int start,
+                                       int end,
+                                       int direction}
   Return the first position of \var{substr} in
   \var{str}[\var{start}:\var{end}] using the given \var{direction}
   (\var{direction} == 1 means to do a forward search,
-  \var{direction} == -1 a backward search), 0 otherwise.
-\end{cfuncdesc}
-
-\begin{cfuncdesc}{PyObject*}{PyUnicode_Count}{PyObject *str,
-                                                  PyObject *substr,
-                                                  int start,
-                                                  int end}
-  Count the number of occurrences of \var{substr} in
-  \var{str}[\var{start}:\var{end}]
+  \var{direction} == -1 a backward search).  The return value is the
+  index of the first match; a value of \code{-1} indicates that no
+  match was found, and \code{-2} indicates that an error occurred and
+  an exception has been set.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{int}{PyUnicode_Count}{PyObject *str,
+                                        PyObject *substr,
+                                        int start,
+                                        int end}
+  Return the number of non-overlapping occurrences of \var{substr} in
+  \code{\var{str}[\var{start}:\var{end}]}.  Returns \code{-1} if an
+  error occurred.
 \end{cfuncdesc}
 
 \begin{cfuncdesc}{PyObject*}{PyUnicode_Replace}{PyObject *str,
index dcc66bc7fb76ac0a007ee614c8ae23cc25a262da..ecc82e164c1f09da9d3ac2c7d7a81bf2ffae9dd9 100644 (file)
@@ -1393,14 +1393,14 @@ PyUnicode_Tailmatch:int:start::
 PyUnicode_Tailmatch:int:end::
 PyUnicode_Tailmatch:int:direction::
 
-PyUnicode_Find:PyObject*::+1:
+PyUnicode_Find:int:::
 PyUnicode_Find:PyObject*:str:0:
 PyUnicode_Find:PyObject*:substr:0:
 PyUnicode_Find:int:start::
 PyUnicode_Find:int:end::
 PyUnicode_Find:int:direction::
 
-PyUnicode_Count:PyObject*::+1:
+PyUnicode_Count:int:::
 PyUnicode_Count:PyObject*:str:0:
 PyUnicode_Count:PyObject*:substr:0:
 PyUnicode_Count:int:start::