Skip to content

Commit

Permalink
Removed cmp from Atom
Browse files Browse the repository at this point in the history
replaced cmp with lt & eq

Required for Issue #260
  • Loading branch information
richardjgowers committed Sep 26, 2015
1 parent 7ba130e commit fb05bc8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions package/MDAnalysis/core/AtomGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
import logging
import os.path
import weakref
import functools

# Local imports
import MDAnalysis
Expand Down Expand Up @@ -453,7 +454,7 @@
_SINGULAR_PROPERTIES = {v: k for k, v in _PLURAL_PROPERTIES.items()}



@functools.total_ordering
class Atom(object):
"""A class representing a single atom.
Expand Down Expand Up @@ -523,8 +524,8 @@ def __repr__(self):
altloc="" if not self.altLoc
else " and altloc {0}".format(self.altLoc)))

def __cmp__(self, other):
return cmp(self.index, other.index)
def __lt__(self, other):
return self.index < other.index

def __eq__(self, other):
return self.index == other.index
Expand Down

0 comments on commit fb05bc8

Please sign in to comment.