Le dimanche 10 septembre 2006 à 23:44 +1000, Nick Coghlan a écrit :
> Interesting. This goes back more towards the model of "no default encoding, 
> but provide the right tools to make it easy for a program to choose one in 
> the 
> absence of any metadata".

In the "clean" API yes.
But it would be nice to also have an easy API for small scripts, hence
my "autotextfile" proposal.
(and, it would also avoid making life too hard for beginners trying to
learn the language)

> f = open(fname, 'r', string.guessencoding(fname))

This one is inefficient because it results in opening the file twice:
once in string.guessencoding(), and once in open().
This does not happen if there is a special argument instead, like
"by_content=True" in my proposal.

Cheers 

Antoine.


_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to