This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients benjamin.peterson, dlesco, facundobatista, lemburg, pitrou, terry.reedy
Date 2013-03-25.22:11:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364249487.28.0.845654349801.issue5445@psf.upfronthosting.co.za>
In-reply-to
Content
I find this to be a confusing issue.

1. The arg for .join is any iterable of strings, not just a list. (I think Daniel got that.) Since codecs.py still has "self.write(''.join(list))":
  a) calling the arg 'list' is doubly wrong.
  b) there is no iterable feature to add, at least not to the base class.

2. The codecs.writelines entry says "Writes the concatenated list of strings to the stream (possibly by reusing the write() method)."  For the base class, that is overly restrictive, but I gather that Marc-Andre does not want to require that all subclasses be as relaxed. I presume there must be a reason. That means that the feature request of doing so is rejected by him. In that respect, this should be closed unless other developers strongly disagree.

3. The iobase.writelines entry says "Write a list of lines to the stream." For StreamIO, iter(somelist) works just as well. If that applies to .writelines in general, the doc should say 'iterable of lines'. (Antoine, Benjamin?)

If io.writelines does the same (concatenate all together), it should say so, but one comment suggests it does not 

4. If an iterable produces millions of lines, it does not matter if it is a list, generator, or any other iterable. So the title does not point to the real problem, if there is one.
History
Date User Action Args
2013-03-25 22:11:27terry.reedysetrecipients: + terry.reedy, lemburg, facundobatista, pitrou, benjamin.peterson, dlesco
2013-03-25 22:11:27terry.reedysetmessageid: <1364249487.28.0.845654349801.issue5445@psf.upfronthosting.co.za>
2013-03-25 22:11:27terry.reedylinkissue5445 messages
2013-03-25 22:11:26terry.reedycreate