# HG changeset patch
# User Jason Grout <jason-sage@creativetrax.com>
# Date 1275165708 18000
# Node ID 1083fcd7fe893037e118272d109dc37165e2c506
# Parent  e8b119f9c858e6f2826bda81788f079b7214f36f
#9089: Make Graphics3dGroup.__add__ not modify its arguments

diff -r e8b119f9c858 -r 1083fcd7fe89 sage/plot/plot3d/base.pyx
--- a/sage/plot/plot3d/base.pyx	Sat May 29 14:51:41 2010 -0500
+++ b/sage/plot/plot3d/base.pyx	Sat May 29 15:41:48 2010 -0500
@@ -1218,6 +1218,19 @@
     """
     This class represents a collection of 3d objects. Usually they are formed
     implicitly by summing.
+
+    TESTS:
+    
+    :meth:`__add__` does not modify its arguments (trac ticket #9089)::
+    
+        sage: a=point3d([1,0,0])+point3d([0,1,0])
+        sage: b=point3d([0,0,1])
+        sage: a_objects=list(a.all)
+        sage: a_objects==a.all
+        True
+        sage: c=a+b
+        sage: a_objects==a.all
+        True
     """
     def __init__(self, all=(), rot=None, trans=None, scale=None, T=None):
         """
@@ -1232,21 +1245,6 @@
         self.aspect_ratio(optimal_aspect_ratios([a.aspect_ratio() for a in all]))
         self._set_extra_kwds(optimal_extra_kwds([a._extra_kwds for a in all if a._extra_kwds is not None]))
 
-    def __add__(self, other):
-        """
-        We override this here to make large sums more efficient.
-
-        EXAMPLES::
-            sage: G = sum(tetrahedron(opacity=1-t/11).translate(t, 0, 0) for t in range(10))
-            sage: G
-            sage: len(G.all)
-            10
-        """
-        if type(self) is Graphics3dGroup and isinstance(other, Graphics3d):
-            self.all.append(other)
-            return self
-        else:
-            return Graphics3d.__add__(self, other)
 
     def bounding_box(self):
         """
