[I18n-sig] Pre-PEP: Proposed Python Character Model
Martin v. Loewis
Thu, 8 Feb 2001 01:21:00 +0100
> There is a reason that Brian and I independently invented the same idea.
> It's because Joe Programmer without a degree in rocket science is going
> to expect it to work that way. Joe Programmer does not know what a codec
> is, will not consider importing the codecs module and will have no idea
> what to do with the object once they've got there hands on it.
> It's a million times easier to tell a programmer: "If you expect to read
> ASCII data add a third argument with the string 'ASCII', if you know
> about encodings choose another one. If you know what raw binary data is,
> and want to read it, here's another function."
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
If he guesses that there is some issue with ASCII in his program, he'd
probably look into the documentation of open(); I agree. If that would
point to codecs.open, I think Joe could arrange to import the codecs
module and invoke the open function.