https://github.com/python/cpython/commit/3ae063947959ca47d9975e92153a98e8a0dba1db
commit: 3ae063947959ca47d9975e92153a98e8a0dba1db
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-06-23T12:08:34Z
summary:

[3.14] gh-151556: Show example CSV file content in the `csv` module docs 
(GH-151563) (#151985)

(cherry picked from commit 7915c4a8dd5b047b1e48b127690fb6a202a6e4ca)

Co-authored-by: Lucas <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Doc/library/csv.rst

diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst
index 5c086ab94229ac..1eb3fe0d490353 100644
--- a/Doc/library/csv.rst
+++ b/Doc/library/csv.rst
@@ -83,6 +83,13 @@ The :mod:`!csv` module defines the following functions:
       Spam, Spam, Spam, Spam, Spam, Baked Beans
       Spam, Lovely Spam, Wonderful Spam
 
+   where :file:`eggs.csv` contains:
+
+   .. code-block:: text
+
+      Spam Spam Spam Spam Spam |Baked Beans|
+      Spam |Lovely Spam| |Wonderful Spam|
+
 
 .. function:: writer(csvfile, /, dialect='excel', **fmtparams)
 
@@ -112,6 +119,13 @@ The :mod:`!csv` module defines the following functions:
           spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])
           spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
 
+   which writes :file:`eggs.csv` containing:
+
+   .. code-block:: text
+
+      Spam Spam Spam Spam Spam |Baked Beans|
+      Spam |Lovely Spam| |Wonderful Spam|
+
 
 .. function:: register_dialect(name, /, dialect='excel', **fmtparams)
 
@@ -193,6 +207,14 @@ The :mod:`!csv` module defines the following classes:
        >>> print(row)
        {'first_name': 'John', 'last_name': 'Cleese'}
 
+   where :file:`names.csv` contains:
+
+   .. code-block:: text
+
+      first_name,last_name
+      Eric,Idle
+      John,Cleese
+
 
 .. class:: DictWriter(f, fieldnames, restval='', extrasaction='raise', \
                       dialect='excel', *args, **kwds)
@@ -230,6 +252,15 @@ The :mod:`!csv` module defines the following classes:
            writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})
            writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})
 
+   which writes :file:`names.csv` containing:
+
+   .. code-block:: text
+
+      first_name,last_name
+      Baked,Beans
+      Lovely,Spam
+      Wonderful,Spam
+
 
 .. class:: Dialect
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to