Message311759
| Author |
cowlinator |
| Recipients |
cowlinator |
| Date |
2018年02月07日.01:51:04 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1517968265.54.0.467229070634.issue32784@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2018年02月07日 01:51:05 | cowlinator | set | recipients:
+ cowlinator |
| 2018年02月07日 01:51:05 | cowlinator | set | messageid: <1517968265.54.0.467229070634.issue32784@psf.upfronthosting.co.za> |
| 2018年02月07日 01:51:05 | cowlinator | link | issue32784 messages |
| 2018年02月07日 01:51:04 | cowlinator | create |
|