# HG changeset patch
# User John Cremona <john.cremona@gmail.com>
# Date 1224449757 -3600
# Node ID e1820d65f8ea1c2a9571a0b3f0e3c7f26ea1f302
# Parent  96f71b1a3b4b70a7f2bca13119eca21e0e8656fc
#4287: add _cmp_ method for Formal Groups to loads(dumps()) test works

diff -r 96f71b1a3b4b -r e1820d65f8ea sage/schemes/elliptic_curves/formal_group.py
--- a/sage/schemes/elliptic_curves/formal_group.py	Tue Oct 14 21:52:44 2008 +0200
+++ b/sage/schemes/elliptic_curves/formal_group.py	Sun Oct 19 21:55:57 2008 +0100
@@ -29,6 +29,21 @@
         True
         """
         self.__E = E
+
+    def __cmp__(self, other):
+        """
+        Compare self and other. 
+        
+        TESTS:
+            sage: E = EllipticCurve('35a')
+            sage: F1 = E.formal_group()
+            sage: F2 = E.formal_group()
+            sage: F1 == F2
+            True
+        """
+        c = cmp(type(self), type(other))
+        if c: return c
+        return cmp(self.__E, other.__E)
 
     def _repr_(self):
         """
