DO NOT USE file() (was Re: altering an object as you iterate over it?)

Aahz aahz at pythoncraft.com
Fri May 19 22:57:52 EDT 2006


In article <e4la8j$od9$1 at daisy.noc.ucla.edu>,
James Stroud  <jstroud at ucla.edu> wrote:
>Paul McGuire wrote:
>> 
>> 1. open("xxx") still works - not sure if it's even deprecated or not - but
>> the new style is to use the file class
>
>Python 2.3.4 (#4, Oct 25 2004, 21:40:10)
>[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>py> open is file
>True

Python 2.5a2 (trunk:46052, May 19 2006, 19:54:46)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> open is file
False

Per the other comments in this thread, Guido agreed that making open() a
synonym of file() was a mistake, and my patch to split them was accepted.
Still need to do more doc update (per Uncle Timmy complaint), but that
shouldn't be too hard.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I saw `cout' being shifted "Hello world" times to the left and stopped
right there."  --Steve Gonedes



More information about the Python-list mailing list