[I18n-sig] Pre-PEP: Proposed Python Character Model

Paul Prescod paulp@ActiveState.com
Wed, 07 Feb 2001 17:10:53 -0800


"Martin v. Loewis" wrote:
> 
> ...
> 
> Of course, if Joe Programmer would suddenly be confronted with all his
> open calls failing, he'd hate the new release, and would start to
> flame comp.lang.python.

I don't believe that open() calls should fail! 

We should present a pair of explicit alternatives for strings and binary
data that are as easy as open() and document them as the recommended
way. We should change the tutorials and the books to encourage people to
choose the right function for the right job. 

Years from now we should deprecate open as an old way of doing things
that has been superceded.

> If he guesses that there is some issue with ASCII in his program, he'd
> probably look into the documentation of open(); I agree. 

How would a user guess that there is "some issue with ASCII." Only the
I18N-heads in this mailing list even understand that there is an issue.
We need to inform people that there is a decision to be made.

> If that would
> point to codecs.open, I think Joe could arrange to import the codecs
> module and invoke the open function.

I think it would be a really big mistake to make the right thing involve
so much more code than the easy thing.

What is your aversion to fopen/stropen/txtopen/binopen or whatever you
want to call them? Why not make life easier?

 Paul Prescod