[issue27073] redundant checks in long_add and long_sub

Oren Milman report at bugs.python.org
Sat May 28 12:50:22 EDT 2016


Oren Milman added the comment:

After giving it some more thought (while working on another, somewhat related issue - http://bugs.python.org/issue27145), I realized that that assert in long_add could further verify that the int x_add returned is a multiple-digit int (as x_add had received two multiple-digit ints to begin with).

The important thing about this updated assert is that it verifies that x_add didn't return a reference to an element in small_ints (as small ints must be single-digit ints), so negating it in-place is safe.

I have updated the assert and added an appropriate comment. The updated diff file is attached.

----------
Added file: http://bugs.python.org/file43044/issue27073.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27073>
_______________________________________


More information about the Python-bugs-list mailing list