From 03c8ab233d2c64a35583a2b39bcdfea59473a4f0 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Tue, 24 Nov 2015 13:31:56 +0200 Subject: [PATCH] make SteamID comperable & hashable --- steam/steamid.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/steam/steamid.py b/steam/steamid.py index 087c98b..60868da 100644 --- a/steam/steamid.py +++ b/steam/steamid.py @@ -159,6 +159,12 @@ class SteamID(object): def __str__(self): return str(self.as_64) + def __cmp__(self, other): + return cmp(self.as_64, other.as_64) + + def __hash__(self): + return hash(self.as_64) + @property def as_steam2(self): return "STEAM_0:%s:%s" % (