Message121056
On Fri, Nov 12, 2010 at 12:54 PM, Terry J. Reedy <report@bugs.python.org> wrote:
..
>>What is the best way to pass around source code?
>> - file-like objects, line iterators, readline-like function?
>
> Line iterator (list of lines) as returned by open().readlines.
> Memory should not be an issue. Read disk once and close.
>
> with open('file', ...) as f:
> src = f.readlines()
Line iterator does not carry the information about source encoding
which may be important for annotating the source code. |
|
Date |
User |
Action |
Args |
2010-11-12 19:09:08 | belopolsky | set | recipients:
+ belopolsky, brett.cannon, terry.reedy, vstinner, eli.bendersky |
2010-11-12 19:09:05 | belopolsky | link | issue10342 messages |
2010-11-12 19:09:05 | belopolsky | create | |
|