Description: Fix ordering tests for Python 3
Author: Stuart Prescott <stuart@debian.org>
Forwarded: https://github.com/schrodinger/pymol-open-source/pull/9
--- a/modules/chempy/__init__.py
+++ b/modules/chempy/__init__.py
@@ -16,11 +16,13 @@
 
 import os
 import copy
+import functools
 
 #
 # Basic chempy types
 #
 
+@functools.total_ordering
 class Atom:
 
     # these must be immutables
@@ -107,7 +109,27 @@
                 cmp(self.symbol, other.symbol) or \
                 cmp(self.name, other.name) or \
                 cmp(id(self), id(other))
-        
+
+    @staticmethod
+    def _order(obj):
+        return (
+            obj.segi,
+            obj.chain,
+            obj.resi_number,
+            obj.resi,
+            obj.resn,
+            obj.symbol,
+            obj.name,
+            id(obj),
+        )
+
+    def __gt__(self, other):
+        return Atom._order(self) > Atom._order(other)
+
+    def __eq__(self, other):
+        return Atom._order(self) == Atom._order(other)
+
+
 class Bond:
 
     order   = 1
