[I18n-sig] Move to codecs.open() as builtin open() (Pre-PEP: Proposed Python Character Model)

M.-A. Lemburg mal@lemburg.com
Thu, 08 Feb 2001 13:40:19 +0100


Uche Ogbuji wrote:
> 
> > Hooper Brian wrote:
> > > ...
> > > What about adding an
> > > optional encoding argument to the existing open(),
> > > allowing encoding to be passed to that, and using 'raw' as
> > > the default format (what it does now)?
> >
> > This is what codecs.open() already provides.
> 
> I think this should be codecs.fopen() to avoid any confusion.

Isn't the need to import it from codecs enough to notice
the difference ?

from codecs import open as fopen

also does the trick in 2.1, BTW.

Perhaps we should make codecs.open the new open() in 2.2 ?!
(the API would have to tweaked a bit though to make the argument
order match the open() API)

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/