[SciPy-user] matrix construction

Fernando Perez Fernando.Perez at colorado.edu
Fri Sep 24 18:13:33 EDT 2004


Stephen Waterbury schrieb:
> Fernando Perez wrote:

>>Less temporaries, these days files are their own iterators ...
> 
> 
> ... or more au courant:
> 
>      for line in file('data')
> 
> -- per the Python library docs:
> 
> "file() is new in Python 2.2. The older built-in open() is an alias
> for file()."

Well, this is getting off-topic, but I used open() deliberately.  There was a 
recent thread on python-dev where Guido himself clarified that he intended 
open() to remain the 'file-open' idiom of choice, with file() being possibly 
reserved in the future for other things.  I don't have a reference handy, but 
after this I've gone back to open() (after having switched to file() for a 
while, based on the docs you point to).

Part of that discussion clarified that the docs were a bit misleading on this 
point, they may have been fixed for 2.4, I don't know.

So open() it is :)

Best,

f




More information about the SciPy-User mailing list