changeset: 68754:2a8580f4897c parent: 68751:07c89f2a0636 parent: 68753:d0d1235cb66e user: R David Murray date: Sun Mar 20 11:33:17 2011 -0400 files: Doc/library/csv.rst description: Markup fixes for #7198 patch. Also corrected the indentation of one of the examples. diff -r 07c89f2a0636 -r 2a8580f4897c Doc/library/csv.rst --- a/Doc/library/csv.rst Sun Mar 20 11:08:10 2011 -0400 +++ b/Doc/library/csv.rst Sun Mar 20 11:33:17 2011 -0400 @@ -79,8 +79,8 @@ Return a writer object responsible for converting the user's data into delimited strings on the given file-like object. *csvfile* can be any object with a - :func:`write` method. If *csvfile* is a file object, - it should be opened with ``newline=''``. [1]_ An optional *dialect* + :func:`write` method. If *csvfile* is a file object, it should be opened with + ``newline=''`` [1]_. An optional *dialect* parameter can be given which is used to define a set of parameters specific to a particular CSV dialect. It may be an instance of a subclass of the :class:`Dialect` class or one of the strings returned by the @@ -476,14 +476,14 @@ And while the module doesn't directly support parsing strings, it can easily be done:: - import csv - for row in csv.reader(['one,two,three']): - print(row) + import csv + for row in csv.reader(['one,two,three']): + print(row) .. rubric:: Footnotes .. [1] If ``newline=''`` is not specified, newlines embedded inside quoted fields will not be interpreted correctly, and on platforms that use ``\r\n`` linendings - on write an extra `\\r` will be added. It should always be safe to specify + on write an extra ``\r`` will be added. It should always be safe to specify ``newline=''``, since the csv module does its own (universal) newline handling.