summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2009-10-19 14:38:14 (GMT)
committerEric Smith <eric@trueblade.com>2009-10-19 14:38:14 (GMT)
commitc12781abcba0ff9ff5f6f7af807634ea4bc49e49 (patch)
treedef23c6ba9b14b9ab2386bb23f4d9321ffcce5c8 /Doc/c-api
parent156692752db98a2e31c4e00f59072b9f221eb9a9 (diff)
downloadcpython-c12781abcba0ff9ff5f6f7af807634ea4bc49e49.zip
cpython-c12781abcba0ff9ff5f6f7af807634ea4bc49e49.tar.gz
cpython-c12781abcba0ff9ff5f6f7af807634ea4bc49e49.tar.bz2
Issue #7169: Document PyFloat_AsString and PyFloat_AsReprString, and note that they are unsafe and deprecated.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/float.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst
index c4099a3..295fb90 100644
--- a/Doc/c-api/float.rst
+++ b/Doc/c-api/float.rst
@@ -92,3 +92,27 @@ Floating Point Objects
be freed.
.. versionadded:: 2.6
+
+
+.. cfunction:: void PyFloat_AsString(char *buf, PyFloatObject *v)
+
+ Convert the argument *v* to a string, using the same rules as
+ :func:`str`. The length of *buf* should be at least 100.
+
+ This function is unsafe to call because it writes to a buffer whose
+ length it does not know.
+
+ .. deprecated:: 2.7
+ Use :func:`PyObject_Str` or :func:`PyOS_double_to_string` instead.
+
+
+.. cfunction:: void PyFloat_AsReprString(char *buf, PyFloatObject *v)
+
+ Same as PyFloat_AsString, except uses the same rules as
+ :func:`repr`. The length of *buf* should be at least 100.
+
+ This function is unsafe to call because it writes to a buffer whose
+ length it does not know.
+
+ .. deprecated:: 2.7
+ Use :func:`PyObject_Repr` or :func:`PyOS_double_to_string` instead.