From 62417708fdb63c7eff0f2921adae898475d2f980 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 15 Feb 2019 21:58:38 +0000 Subject: [PATCH] Better name for container back-reference attribute Mangle name with swig so as not to clash with any attribute names a user might use. Remove Doxygen style comments - we don't use Doxygen in SWIG. --- Lib/python/pycontainer.swg | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Lib/python/pycontainer.swg b/Lib/python/pycontainer.swg index ec31bad0d..a2ee9522c 100644 --- a/Lib/python/pycontainer.swg +++ b/Lib/python/pycontainer.swg @@ -44,7 +44,7 @@ %fragment("reference_container_owner", "header", fragment="container_owner_attribute_init") { namespace swig { PyObject* container_owner_attribute() { - static PyObject* attr = SWIG_Python_str_FromChar("__owner"); + static PyObject* attr = SWIG_Python_str_FromChar("__swig_container"); return attr; } @@ -52,18 +52,19 @@ namespace swig { struct container_owner { // By default, do not add the back-reference (for value types) // Specialization below will check the reference for pointer types. - static bool reference(PyObject* child, PyObject* owner) - { return false; } + static bool reference(PyObject* child, PyObject* owner) { + return false; + } }; template <> struct container_owner { - /** + /* * Call to add a back-reference to the owning object when returning a - * reference from a container. Will only set the reference if child + * reference from a container. Will only set the reference if child * is a SWIG wrapper object that does not own the pointer. * - * @return if the reference was set or not + * returns whether the reference was set or not */ static bool reference(PyObject* child, PyObject* owner) { SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child);