New submission from cowlinator <cowlina...@gmail.com>:

The documentation for the csv.DictReader constructor (and presumably 
csv.DictWriter also) has the wrong name written for the first argument.  This 
prevents the argument from being called by name.

>>> file = open("file.txt", 'a')
>>> csv.DictReader(csvfile=file)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() takes at least 2 arguments (1 given)
>>> csv.DictReader(f=file)
<csv.DictReader instance at 0x04D97A08>
>>> # how could i have known it was named 'f'?

Please change the documentation.

----------
messages: 311759
nosy: cowlinator
priority: normal
severity: normal
status: open
title: Wrong argument name for csv.DictReader in documentation
versions: Python 2.7, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32784>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to