Skip to content

gh-92391: Add __class_getitem__ to csv.DictReader and csv.DictWriter #92393

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 3 commits into from
May 8, 2022

Conversation

cdce8p
Copy link
Contributor

@cdce8p cdce8p commented May 6, 2022

Closes #92391

@AlexWaygood AlexWaygood added type-feature A feature request or enhancement topic-typing labels May 6, 2022
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

This makes sense to me.

I'm not 100% confident that the stubs for these classes in typeshed are "stable" -- I'm slightly nervous that we'll continue to fiddle with the stubs for these classes in typeshed. More detailed thoughts here: python/typeshed#7787 (comment).

However, I am fairly confident that these classes will continue to be generic in typeshed, even if we do make other changes to the stubs. And that's the only thing that's relevant to whether __class_getitem__ should be added to the classes.

@AlexWaygood
Copy link
Member

I believe we may have just missed the 3.11 feature freeze, however. So I guess we'll have to wait for 3.12 :)

@AlexWaygood
Copy link
Member

I see the Azure Pipelines failure is a docs failure relating to "What's New in 3.11", which you haven't changed in this PR 🙃

@Fidget-Spinner
Copy link
Member

Yeah we missed 3.11 by around an hour. Bummer :(.

@cdce8p
Copy link
Contributor Author

cdce8p commented May 8, 2022

Merged upstream/main to see if that resolves the docs issue.

@JelleZijlstra JelleZijlstra merged commit 5ed5c56 into python:main May 8, 2022
@JelleZijlstra
Copy link
Member

First new feature for 3.12!

@cdce8p cdce8p deleted the csv-class_getitem branch May 8, 2022 14:30
@cdce8p
Copy link
Contributor Author

cdce8p commented May 8, 2022

First new feature for 3.12!

Nice! Also my first CPython PR 😄

@AlexWaygood
Copy link
Member

First new feature for 3.12!

Nice! Also my first CPython PR 😄

Congrats! :D

@GPHemsley-RELX
Copy link

This change isn't noted in the documentation for csv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-typing type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

csv.DictReader and DictWriter not subscriptable at runtime
6 participants