]> granicus.if.org Git - python/commitdiff
Remove the deprecated and useless "pend" argument from
authorGeorg Brandl <georg@python.org>
Sun, 18 Mar 2007 18:35:15 +0000 (18:35 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 18 Mar 2007 18:35:15 +0000 (18:35 +0000)
PyFloat_FromString. (fixes bug #1650903)

Doc/api/concrete.tex
Doc/api/refcounts.dat
Include/floatobject.h
Misc/NEWS
Objects/abstract.c
Objects/floatobject.c

index e2d3e52f53428ae92f9f9cae7d87aaab6dac8060..630a7261160d9022ee3c36b3ea4c328b6d4430f5 100644 (file)
@@ -430,10 +430,9 @@ booleans.  The following macros are available, however.
   \versionadded{2.2}
 \end{cfuncdesc}
 
-\begin{cfuncdesc}{PyObject*}{PyFloat_FromString}{PyObject *str, char **pend}
+\begin{cfuncdesc}{PyObject*}{PyFloat_FromString}{PyObject *str}
   Create a \ctype{PyFloatObject} object based on the string value in
-  \var{str}, or \NULL{} on failure.  The \var{pend} argument is ignored.  It
-  remains only for backward compatibility.
+  \var{str}, or \NULL{} on failure.
 \end{cfuncdesc}
 
 \begin{cfuncdesc}{PyObject*}{PyFloat_FromDouble}{double v}
index 019bfd4ef8362b27db166922fad8ff5b4162a23a..54197c804d796b0f58ad96aaac545d19c6a506ae 100644 (file)
@@ -385,7 +385,6 @@ PyFloat_FromDouble:double:v::
 
 PyFloat_FromString:PyObject*::+1:
 PyFloat_FromString:PyObject*:str:0:
-PyFloat_FromString:char**:pend:0:ignored
 
 PyFrozenSet_New:PyObject*::+1:
 PyFrozenSet_New:PyObject*:iterable:0:
index c3c18afcd73d5c4ed41e6d4f70450939357f8185..b535e34f34d2290014952f24fa3160e4c0844659 100644 (file)
@@ -21,10 +21,8 @@ PyAPI_DATA(PyTypeObject) PyFloat_Type;
 #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
 #define PyFloat_CheckExact(op) ((op)->ob_type == &PyFloat_Type)
 
-/* Return Python float from string PyObject.  Second argument ignored on
-   input, and, if non-NULL, NULL is stored into *junk (this tried to serve a
-   purpose once but can't be made to work as intended). */
-PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*, char** junk);
+/* Return Python float from string PyObject. */
+PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*);
 
 /* Return Python float from C double. */
 PyAPI_FUNC(PyObject *) PyFloat_FromDouble(double);
index 7791a459c5523001b064388404fa146d6c1d8574..e7ac139ceb5129dc7af31d0a5024ab523a105c1b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -28,6 +28,9 @@ TO DO
 Core and Builtins
 -----------------
 
+- The long-deprecated argument "pend" of PyFloat_FromString() has been
+  removed.
+
 - The dir() function has been extended to call the __dir__() method on
   its argument, if it exists. If not, it will work like before. This allows
   customizing the output of dir() in the presence of a __getattr__().
index a301287b1951da27bd3aa414637b61406f2180a4..5a34b960e050794081d8199727aea3eb5dccc850 100644 (file)
@@ -968,7 +968,7 @@ PyNumber_Float(PyObject *o)
                PyFloatObject *po = (PyFloatObject *)o;
                return PyFloat_FromDouble(po->ob_fval);
        }
-       return PyFloat_FromString(o, NULL);
+       return PyFloat_FromString(o);
 }
 
 /* Operations on sequences */
index 514dd39cd1ac601b02d3725071444ba3626949c4..9e6db549edafd310f7917ad31447d59f4362bc00 100644 (file)
@@ -62,24 +62,8 @@ PyFloat_FromDouble(double fval)
        return (PyObject *) op;
 }
 
-/**************************************************************************
-RED_FLAG 22-Sep-2000 tim
-PyFloat_FromString's pend argument is braindead.  Prior to this RED_FLAG,
-
-1.  If v was a regular string, *pend was set to point to its terminating
-    null byte.  That's useless (the caller can find that without any
-    help from this function!).
-
-2.  If v was a Unicode string, or an object convertible to a character
-    buffer, *pend was set to point into stack trash (the auto temp
-    vector holding the character buffer).  That was downright dangerous.
-
-Since we can't change the interface of a public API function, pend is
-still supported but now *officially* useless:  if pend is not NULL,
-*pend is set to NULL.
-**************************************************************************/
 PyObject *
-PyFloat_FromString(PyObject *v, char **pend)
+PyFloat_FromString(PyObject *v)
 {
        const char *s, *last, *end;
        double x;
@@ -89,8 +73,6 @@ PyFloat_FromString(PyObject *v, char **pend)
 #endif
        Py_ssize_t len;
 
-       if (pend)
-               *pend = NULL;
        if (PyString_Check(v)) {
                s = PyString_AS_STRING(v);
                len = PyString_GET_SIZE(v);
@@ -852,7 +834,7 @@ float_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:float", kwlist, &x))
                return NULL;
        if (PyString_Check(x))
-               return PyFloat_FromString(x, NULL);
+               return PyFloat_FromString(x);
        return PyNumber_Float(x);
 }