summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 14:45:38 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 15:16:03 (GMT)
commitf7a5a1e2ab2ccb0d3e5f7769944f546d8cc060c0 (patch)
treed3c511d3d00d9b020c50904aafb1270219579cf9
parent5c4ab229ac0dfe0b877636b0d12e10ba343bbed2 (diff)
Player: if Debug.hand, assert that Player.hand is always current
-rw-r--r--src/player.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/player.py b/src/player.py
index f3bb857..e84f5db 100644
--- a/src/player.py
+++ b/src/player.py
@@ -226,10 +226,12 @@ class Player(StrMixin):
@property
def hand(self):
- """a readonly tuple"""
-# TODO: str or what?
+ """readonly: the current Hand. Compute if invalidated."""
if not self._hand:
self._hand = self.__computeHand()
+ elif Debug.hand:
+ _ = self.__computeHand()
+ assert self._hand == self.__computeHand(), '{} != {}'.format(_, self._hand)
return self._hand
@property