[Pythonmac-SIG] Re: [Python-Dev] Import hook to do end-of-line conversion?

Chris Barker chrishbarker@home.net
Mon, 09 Apr 2001 11:47:25 -0700


Guido van Rossum wrote:
> No, but (as has been explained) fixing the parser isn't enough -- all
> tools dealing with source would have to be fixed.  Or we would have to
> write our own C-level file object, which has its own drawbacks.

>From what people have posted, it seems clear that having our own C-level
file object is the only reasonable choice. It would take care of all the
issues that have been brought up (both code and other text files, etc).
Even if people have been sloppy and used binary mode for text files
under *nix, that code would still work with *nix text files, which is
the only way it works now anyway.

Given that something like this has been done in numerous places (JAVA,
MATLAB, ???), It seems likely that there is some code out there that
could be used. Hopefully there is some without licensing issues (Maybe
Scilab or Octave, both are MATLAB clones)

What are the drawbacks?? (besides the below example)

I'm not sure who wrote:
> what happens under oddball systems like OpenVMS, which seem to use
> radically different file structures for text and binary data?  I've no idea
> what happens if you try to open a text file in binary mode under those.

Would we have to? At the Python level, you would open a text file, and
get what you expected. The "oddball" port would have to have some
probably very different code for the C-level file object, but that's
presumable the case anyway. what happens when you want to read a
non-native text file on those systems now? So you have to read it as
binary?

By the way, does any of this tie in at all with trying to add Perl-like
speed to processing text files?

-Chris



-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker@home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------