aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/pyext/repeated_scalar_container.cc
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:00:41 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:00:41 -0700
commit6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 (patch)
treee575738adf52d24b883cca5e8928a5ded31caba1 /python/google/protobuf/pyext/repeated_scalar_container.cc
parente7746f487cb9cca685ffb1b3d7dccc5554b618a4 (diff)
downloadprotobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.gz
protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.bz2
protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.zip
Down-integrate from google3.
Diffstat (limited to 'python/google/protobuf/pyext/repeated_scalar_container.cc')
-rw-r--r--python/google/protobuf/pyext/repeated_scalar_container.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/google/protobuf/pyext/repeated_scalar_container.cc b/python/google/protobuf/pyext/repeated_scalar_container.cc
index de3b6e14..cdb64269 100644
--- a/python/google/protobuf/pyext/repeated_scalar_container.cc
+++ b/python/google/protobuf/pyext/repeated_scalar_container.cc
@@ -663,6 +663,10 @@ static PyObject* ToStr(PyObject* pself) {
return PyObject_Repr(list.get());
}
+static PyObject* MergeFrom(PyObject* pself, PyObject* arg) {
+ return Extend(reinterpret_cast<RepeatedScalarContainer*>(pself), arg);
+}
+
// The private constructor of RepeatedScalarContainer objects.
PyObject *NewContainer(
CMessage* parent, const FieldDescriptor* parent_field_descriptor) {
@@ -776,6 +780,8 @@ static PyMethodDef Methods[] = {
"Removes an object from the repeated container." },
{ "sort", (PyCFunction)Sort, METH_VARARGS | METH_KEYWORDS,
"Sorts the repeated container."},
+ { "MergeFrom", (PyCFunction)MergeFrom, METH_O,
+ "Merges a repeated container into the current container." },
{ NULL, NULL }
};