summaryrefslogtreecommitdiff
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-09-30 21:31:21 -0400
committerBenjamin Peterson <benjamin@python.org>2011-09-30 21:31:21 -0400
commitcd6c51adb67b308df10d175f2e1afc94d8742e1b (patch)
tree75dadb7e66da1f4cdbb3b384d896d422f8df03b5 /Python/ceval.c
parent6c70016076d4788632d54874c2ebe63174dfbfe0 (diff)
downloadcpython-cd6c51adb67b308df10d175f2e1afc94d8742e1b.tar.gz
remove "fast-path" for (i)adding strings
These were just an artifact of the old unicode concatenation hack and likely just penalized other kinds of adding. Also, this fixes __(i)add__ on string subclasses.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index f6f422ee32..870d19d55c 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1507,10 +1507,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
TARGET(BINARY_ADD)
w = POP();
v = TOP();
- if (PyUnicode_Check(v) && PyUnicode_Check(w))
- x = PyUnicode_Concat(v, w);
- else
- x = PyNumber_Add(v, w);
+ x = PyNumber_Add(v, w);
Py_DECREF(v);
Py_DECREF(w);
SET_TOP(x);
@@ -1662,10 +1659,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
TARGET(INPLACE_ADD)
w = POP();
v = TOP();
- if (PyUnicode_Check(v) && PyUnicode_Check(w))
- x = PyUnicode_Concat(v, w);
- else
- x = PyNumber_InPlaceAdd(v, w);
+ x = PyNumber_InPlaceAdd(v, w);
Py_DECREF(v);
Py_DECREF(w);
SET_TOP(x);