Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update csv.rst
Improve descriptions of QUOTE_NOTNULL and QUOTE_STRINGS with writer objects. Add descriptions for reader objects.
  • Loading branch information
samwyse authored Apr 11, 2023
commit d2337816ce9251056a242cf4ddb971a656940791
18 changes: 12 additions & 6 deletions Doc/library/csv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ The :mod:`csv` module defines the following constants:

Instructs :class:`writer` objects to quote all non-numeric fields.

Instructs the reader to convert all non-quoted fields to type *float*.
Instructs :class:`reader` to convert all non-quoted fields to type *float*.


.. data:: QUOTE_NONE
Expand All @@ -342,14 +342,20 @@ The :mod:`csv` module defines the following constants:
.. data:: QUOTE_NOTNULL

Instructs :class:`writer` objects to quote all fields which are not
``None``. If a field value is ``None`` an empty (unquoted) string
is written.
``None``. This is similar to QUOTE_ALL, except that if a
field value is ``None`` an empty (unquoted) string is written.

Instructs :class:`reader` to interpret an empty (unquoted) field as None, and
otherwise behave as QUOTE_ALL.

.. data:: QUOTE_STRINGS

Instructs :class:`writer` quotes are always placed around fields
which are strings. Note that ``None`` will be written as a
bar (unquoted) empty string.
Instructs :class:`writer` objects to always place quotes around fields
which are strings. This is similar to QUOTE_NONNUMERIC, except that if a
field value is ``None`` an empty (unquoted) string is written.

Instructs :class:`reader` to interpret an empty (unquoted) string as None, and
otherwise behave as QUOTE_NONNUMERIC.

The :mod:`csv` module defines the following exception:

Expand Down