From 5a3e8e5bc080fd37299dc0276d8efd5738b9e9ce Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 27 Feb 2016 23:34:54 -0800 Subject: Issue 13573: Document that csv.writer uses str() for floats instead of repr(). --- Doc/library/csv.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst index d3d505e..dbef60f 100644 --- a/Doc/library/csv.rst +++ b/Doc/library/csv.rst @@ -112,6 +112,7 @@ The :mod:`csv` module defines the following functions: value :const:`None` is written as the empty string. While this isn't a reversible transformation, it makes it easier to dump SQL NULL data values to CSV files without preprocessing the data returned from a ``cursor.fetch*`` call. + Floats are stringified with :func:`repr` before being written. All other non-string data are stringified with :func:`str` before being written. A short usage example:: -- cgit v0.12