[RFC] bzr.jrydberg.versionedfile
Aaron Bentley
aaron.bentley at utoronto.ca
Wed Dec 21 16:59:28 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Johan Rydberg wrote:
> Aaron Bentley <aaron.bentley at utoronto.ca> writes:
>
>
>>Johan Rydberg wrote:
>>
>>>I disagree. I think get_text should be the primary operation, and
>>>that it should return a list of lines. If you want it as a string,
>>>we'll provide a convenience method for you.
>>
>>How about an iterable of lines, rather than a list per se? Maybe it's
>>moot, given that we have to load the whole thing in memory while parsing
>>the knit, but I can imagine cases in which we'd only want part of the
>>file in memory at a time.
>
>
> What cases is that?
Cases where the file size is greater than a gigabyte. You can imagine a
version of the knit parser that could target a particular range of
output lines, so you could read, say, 50M lines at a time.
> So if you just want part of the lines in memory after the call to
> get_text, it is probably better to do; get_text(...)[x:x+N].
This is alright, but it requires that the implementation generate a list.
But I'll withdraw my suggestion. Lists are nice and convenient. If it
turns out
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDqYnw0F+nu1YWqI0RAvJKAJ4trweifjOxhvys5X0/aKaATNBGZwCeP1Ki
TOzfsS60sJ1CC6LNbSOTv5M=
=3jFv
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list