Message314541
> A fileobj property would be convenient, as you otherwise, for example, need to pass an extra argument to routines that need both the csv object and the underlying file object.
But you should already have this object for creating csv.reader() or csv.writer().
Even if keep the argument of the constructor as an instance attribute, there is a problem with naming this attribute. csv.reader works not only with files. It accepts arbitrary iterable.
>>> it = iter(['Spam, Spam, Spam, Spam, Spam, Baked Beans', 'Spam, Lovely Spam, Wonderful Spam'])
>>> list(csv.reader(it))
[['Spam', ' Spam', ' Spam', ' Spam', ' Spam', ' Baked Beans'], ['Spam', ' Lovely Spam', ' Wonderful Spam']]
The dialect property is not a copy of the dialect constructer argument. |
|
Date |
User |
Action |
Args |
2018-03-27 17:17:55 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, samwyse |
2018-03-27 17:17:55 | serhiy.storchaka | set | messageid: <1522171075.57.0.467229070634.issue33158@psf.upfronthosting.co.za> |
2018-03-27 17:17:55 | serhiy.storchaka | link | issue33158 messages |
2018-03-27 17:17:55 | serhiy.storchaka | create | |
|