Created
January 2, 2020 19:28
-
-
Save arpitbbhayani/88215842f8d841bbf1b229a974131d53 to your computer and use it in GitHub Desktop.
Python code to evaluate addition of two operands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case TARGET(BINARY_ADD): { | |
PyObject *right = POP(); | |
PyObject *left = TOP(); | |
PyObject *sum; | |
if (PyUnicode_CheckExact(left) && | |
PyUnicode_CheckExact(right)) { | |
sum = unicode_concatenate(tstate, left, right, f, next_instr); | |
} | |
else { | |
sum = PyNumber_Add(left, right); | |
} | |
SET_TOP(sum); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment