[Python-3000] Pre-PEP: Easy Text File Decoding

Nick Coghlan ncoghlan at gmail.com
Sun Sep 10 13:58:00 CEST 2006


Antoine Pitrou wrote:
> So, here is an alternative proposal :
> Make it so that textfile() doesn't recognize system-wide defaults (as in
> your proposal), but also provide autotextfile() which would recognize
> those defaults (with a by_content=False optional argument to enable
> content-based guessing).
> 
> textfile() being clearly marked for use by large well thought-out
> applications, and autotextfile() for small scripts and the like.
> Different names make it clear that they are for different uses, and
> allow to spot them easily when looking at source code (either by a human
> reader or a quality measurement tool).

How does your "autotextfile('myfile.txt')" differ from Paul's 
"textfile('myfile.txt', encoding='guess')"?

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list