[MERGE] get_record_stream().get_bytes_as('chunked')
John Arbash Meinel
john at arbash-meinel.com
Thu Dec 11 13:49:36 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Vincent Ladeuil wrote:
>>>>>> "vila" == Vincent Ladeuil <v.ladeuil+lp at free.fr> writes:
>
> <snip/>
>
> jam> +
> jam> + break else: return chunks
>
> vila> Nit-picking: break that line into three, the 'return chunks' part
> vila> is the most important line of the function, don't hide it.
>
> Forget that, citation error, the code is indeed on 3 lines.
>
> *But* I have to remove the 'cur = 0' and 'cur += 1' lines to make
> pyrex happy (they seems useless anyway, debug lines left ?).
>
> Vincent
>
I would assume you only have to remove the "cur += 1" line, and replace
it with:
cur = cur + 1
Older versions of pyrex don't support "+=" notation. Newer versions do.
They are actually necessary, because we allow the last line to not be
newline terminated. (A lot of texts don't end with a newline.)
I could write the whole thing differently, buffering an entry if it
doesn't contain a newline and only failing if there is another entry.
But I'm pretty sure a test would fail, since there is:
"cur == chunks_len" later on.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAklBGnAACgkQJdeBCYSNAANR2ACgtAyhAUz5zzDR6MPprg4nJtWs
2Z4AniWVUgyL3NRvcdaLNE3ft9uQ22EF
=xlCF
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list