From 41fe391c2a60f6810b2c2fc6eba1f88d810702cc Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 30 Oct 2011 20:05:50 -1000 Subject: [PATCH] can only compare Block against another Block (for now) --- materials.py | 1 + 1 file changed, 1 insertion(+) diff --git a/materials.py b/materials.py index 81fcc74..2d9965c 100644 --- a/materials.py +++ b/materials.py @@ -31,6 +31,7 @@ class Block(object): return str(self) def __cmp__(self, other): + if not isinstance(other, Block): return False key = lambda a:a and (a.ID, a.blockData) return cmp( key(self), key(other))