10000 gh-67230: add quoting rules to csv module by smontanaro · Pull Request #29469 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-67230: add quoting rules to csv module #29469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 12, 2023
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
Harmonize references to reader and writer objects.  Change to "instructs reader to interpret ... and to otherwise behave"
  • Loading branch information
samwyse authored Apr 12, 2023
commit a32ef44a69b778770ddc7a3038750f9f97586df1
16 changes: 8 additions & 8 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 :class:`reader` to convert all non-quoted fields to type *float*.
Instructs :class:`reader` objects to convert all non-quoted fields to type *float*.


.. data:: QUOTE_NONE
Expand All @@ -337,25 +337,25 @@ The :mod:`csv` module defines the following constants:
character. If *escapechar* is not set, the writer will raise :exc:`Error` if
any characters that require escaping are encountered.

Instructs :class:`reader` to perform no special processing of quote characters.
Instructs :class:`reader` objects to perform no special processing of quote characters.

.. data:: QUOTE_NOTNULL

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

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

.. data:: QUOTE_STRINGS

Instructs :class:`writer` objects to always place quotes around fields
which are strings. This is similar to QUOTE_NONNUMERIC, except that if a
which are strings. This is similar to :data:`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.
Instructs :class:`reader`objects to interpret an empty (unquoted) string as None and
to otherwise behave as :data:`QUOTE_NONNUMERIC`.

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

Expand Down
0