Skip to content
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

bpo-14935: Remove static state from the _csv module #23224

Merged
merged 12 commits into from
Dec 15, 2020

Conversation

encukou
Copy link
Member

@encukou encukou commented Nov 10, 2020

This merges code/ideas from gh-20974 and gh-16078, and uses the new _PyType_GetModuleByDef.

Co-authored-by: Marcel Plch gmarcel.plch@gmail.com
Co-authored-by: Eddie Elizondo eduardo.elizondorueda@gmail.com
Co-authored-by: Hai Shi shihai1992@gmail.com

https://bugs.python.org/issue14935

Uses code from: python#16078

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
Co-authored-by: Hai Shi <shihai1992@gmail.com>
Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Show resolved Hide resolved
Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Show resolved Hide resolved
Modules/_csv.c Show resolved Hide resolved
Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Show resolved Hide resolved
Modules/_csv.c Show resolved Hide resolved
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. IMO the code is cleaner with your changes, thanks.

I just added a minor coding style remark, feel free to ignore it ;-)

Modules/_csv.c Outdated

PyType_Spec Writer_Type_spec = {
"_csv.writer",
sizeof(WriterObj),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use ".m_xxx = xxx" syntax here, as you did for the other spec below. Same remark for Reader_Type_spec.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

Copy link
Member

@shihai1991 shihai1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no other comments, so LGTM.

@encukou encukou merged commit 6a02b38 into python:master Dec 15, 2020
@encukou encukou deleted the pep-573-walker-and-csv branch December 15, 2020 14:14
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Uses code from: python#16078

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
Co-authored-by: Hai Shi <shihai1992@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants