Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Feature or enhancement
Add PEP 585 style__class_getitem__ tocsv.DictReader andcsv.DictWriter.
Pitch
With PEP 585 most generic stdlib types are now subscriptable at runtime. BothDictReader andDictWriter are generic in typeshed but don't yet implement__class_getitem__.
fromcsvimportDictWriterfromtypingimportIOdeff(fp:IO[str])->DictWriter[str]:returnDictWriter(fp, ["id","name"])
Previous discussion