Keith Dart wrote: > On Thu, 2003-12-11 at 14:24, Skip Montanaro wrote: > >> Keith> class TextFile(UserFile): >> Keith> """TextFile(self, name, mode="r", bufsize=-1, linesep=None) >> Keith> A file object that handles different line separator >> Keith> conventions. This file object's readline() method returns the >> Keith> line with trailing line separator stripped, and raises EOFError >> Keith> on end of file. The writelines() method will append an >> Keith> appropriate line separator when writing. Thus, this file object >> Keith> allows reading and writeing non-native text files. >> Keith> """ >> >>Is there a reason the universal newline mode doesn't cover this case >>already? > > > This module lets you explicitly create a text data file for any > platform. The universal newline feature of python is for Python modules > only, and lets you transparently import and exec Python source files > with the different line ending formats. That is a different thing. > Not true. Python 2.3 added the "U" option for file opening to use universal newline support for any file you open. See http://www.python.org/doc/2.3/whatsnew/node7.html . -Brett
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4