large dictionary creation takes a LOT of time.

Kent Johnson kent37 at tds.net
Fri Apr 29 12:00:37 EDT 2005


Maksim Kasimov wrote:
> Kent Johnson wrote:
>  > for line in open(path):
> the line of your example raise another question: opened file will be 
> read at once time, as method readlines() do, or it will be read line by 
> line as method readline() do.

It will be read line by line as readline() does.

> as far i know, it is depends on implementation of method "__iter__" of 
> the object that "open()" returns, so another question: where i can find 
> such an information (about how does such a functions works)?

http://docs.python.org/lib/built-in-funcs.html
http://docs.python.org/lib/bltin-file-objects.html

Kent



More information about the Python-list mailing list