Skip to content

gh-155097: Add converter and formatter parameters in csv.reader and csv.writer - #155099

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:csv-converter-formatter
Open

gh-155097: Add converter and formatter parameters in csv.reader and csv.writer#155099
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:csv-converter-formatter

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

The converter parameter of csv.reader is used instead of float() for converting unquoted fields, and the formatter parameter of csv.writer is used instead of str() for converting values to strings. Both are called with the 0-based position of the field in the row as the first argument, so the conversion can depend on the column.

… and csv.writer

They are used instead of float() and str() for converting between fields and
values.  Both take the 0-based position of the field in the row as the first
argument, so the conversion can depend on the column.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33877923 | 📁 Comparing c528f7c against main (204feba)

  🔍 Preview build  

3 files changed
± library/csv.html
± whatsnew/3.16.html
± whatsnew/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review extension-modules C modules in the Modules dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant