[Python-Dev] str object going in Py3K (original) (raw)
Alex Martelli aleaxit at gmail.com
Tue Feb 14 23:37:59 CET 2006
- Previous message: [Python-Dev] Missing PyCon 2006
- Next message: [Python-Dev] str object going in Py3K
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2/14/06, Just van Rossum <just at letterror.com> wrote: ...
Maybe it's even better to use opentext() AND openbinary(), and deprecate plain open(). We could even introduce them at the same time as bytes() (and leave the open() deprecation for 3.0).
What about shorter names, such as 'text' instead of 'opentext' and 'data' instead of 'openbinary'? By eschewing the 'open' prefix we might make it easy to eventually migrate off it. Maybe text and data could be two subclasses of file, with file remaining initially as it is (and perhaps becoming an abstract-only baseclass at the time 'open' is deprecated).
In real life, people do all the time use 'open' inappropriately (on non-text files on Windows): one of the most frequent tasks on python-help has to do with diagnosing that this is what happened and suggest the addition of an explicit 'rb' or 'wb' argument. This unending chore, in particular, makes me very wary of forever keeping open to mean "open this text file".
Alex
- Previous message: [Python-Dev] Missing PyCon 2006
- Next message: [Python-Dev] str object going in Py3K
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]