From: <umg...@us...> - 2006-10-08 20:07:56
|
Revision: 348 http://svn.sourceforge.net/pybridge/?rev=348&view=rev Author: umgangee Date: 2006-10-08 13:07:52 -0700 (Sun, 08 Oct 2006) Log Message: ----------- Fix logic error in __eq__, which was triggered when comparing hands. Modified Paths: -------------- trunk/pybridge/pybridge/bridge/card.py Modified: trunk/pybridge/pybridge/bridge/card.py =================================================================== --- trunk/pybridge/pybridge/bridge/card.py 2006-10-08 15:01:55 UTC (rev 347) +++ trunk/pybridge/pybridge/bridge/card.py 2006-10-08 20:07:52 UTC (rev 348) @@ -41,8 +41,9 @@ def __eq__(self, other): """Two cards are equivalent if their ranks and suits match.""" - assert isinstance(other, Card) - return self.suit == other.suit and self.rank == other.rank + if isinstance(other, Card): + return self.suit == other.suit and self.rank == other.rank + return False def __cmp__(self, other): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |