[Python-Dev] [Python-checkins] cpython: Issue #14716: Change integer overflow check in unicode_writer_prepare()

Greg Ewing greg.ewing at canterbury.ac.nz
Tue May 8 01:12:09 CEST 2012


Mark Dickinson wrote:

> Is the gain from this kind of micro-optimization really worth the cost
> of replacing obviously correct code with code whose correctness needs
> several minutes of thought?

The original code isn't all that obviously correct to me either.
I would need convincing that the arithmetic being used to check
for overflow can't itself suffer from overflow. At least that
much is obvious from the new version.

-- 
Greg


More information about the Python-Dev mailing list