"""
import re
+import types
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
d[key] = self.restval
return d
+ __class_getitem__ = classmethod(types.GenericAlias)
+
class DictWriter:
def __init__(self, f, fieldnames, restval="", extrasaction="raise",
def writerows(self, rowdicts):
return self.writer.writerows(map(self._dict_to_list, rowdicts))
+ __class_getitem__ = classmethod(types.GenericAlias)
+
# Guard Sniffer's type checking against builds that exclude complex()
try:
complex
from concurrent.futures.thread import _WorkItem
from contextlib import AbstractContextManager, AbstractAsyncContextManager
from contextvars import ContextVar, Token
+from csv import DictReader, DictWriter
from dataclasses import Field
from functools import partial, partialmethod, cached_property
from graphlib import TopologicalSorter
WeakSet, ReferenceType, ref,
ShareableList,
Future, _WorkItem,
- Morsel]
+ Morsel,
+ DictReader, DictWriter]
if ctypes is not None:
generic_types.extend((ctypes.Array, ctypes.LibraryLoader))
if ValueProxy is not None:
Pablo Mouzo
Mher Movsisyan
Ruslan Mstoi
+Marc Mueller
Valentina Mukhamedzhanova
Michael Mulich
Sape Mullender
--- /dev/null
+Add :meth:`~object.__class_getitem__` to :class:`csv.DictReader` and
+:class:`csv.DictWriter`, allowing them to be parameterized at runtime.
+Patch by Marc Mueller.