New submission from Oren Milman:

------------ the proposed changes ------------
In Objects/longobject.c in long_add and long_sub, the variables 'result' and 
'r' (respectively), are used only once, and don't seem to make the code any 
clearer.

It seems the 'result' and 'r' variables were added in revision 40751. Back 
then, CONVERT_BINOP was used, and required calling Py_DECREF for a and b before 
returning.
Later on, in revision 43313, CONVERT_BINOP was removed, along with the calls to 
Py_DECREF it required, but the 'result' and 'r' variables were left untouched, 
and remained there to this day.


------------ diff ------------
The patches diff is attached.


------------ tests ------------
I built the patched CPython for x86, and played with it a little. Everything 
seemed to work as usual.

In addition, I ran 'python -m test' (on my 64-bit Windows 10) before and after 
applying the patch, and got quite the same output.
the outputs of both runs are attached.

----------
components: Interpreter Core
files: proposedPatches.diff
keywords: patch
messages: 266271
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: redundant variables in long_add and long_sub
versions: Python 3.6
Added file: http://bugs.python.org/file42973/proposedPatches.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27111>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to