Marc-Andre Lemburg <m...@egenix.com> added the comment: For the common case where list is in fact a sequence of strings, the used implementation is a lot faster and more efficient than the one you propose.
Note that the method doesn't pretend to support generators for the list argument, so adding support for iterators would be a feature request, not a bug report. Furthermore, the StreamWriter method can easily be overridden by the codec's own implementation (the version in codecs.py is the base method defining the interface and providing a default implementation), so adding support to the base method will not necessarily mean that all codecs then support iterators as parameter to .writelines(). IMHO, it's better to use the .write() method in a for-loop of your application if you want to support iterators that generate a lot of output. ---------- message_count: 2.0 -> 3.0 nosy: +lemburg nosy_count: 2.0 -> 3.0 type: -> feature request _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5445> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com