Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, f, fieldnames=None, restkey=None, restval=None,
dialect="excel", *args, **kwds):
# Preserve file since we're going to start reading it
self._file = f
# Preserve reader options since we'll need to make another one
readeropts = [f, dialect]
readeropts.extend(args)
self._readeropts = (readeropts, kwds)
csv.DictReader.__init__(self, f, fieldnames, restkey, restval,
dialect, *args, **kwds)