Commit f7a5a1e2 authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

Player: if Debug.hand, assert that Player.hand is always current

parent 5c4ab229
......@@ -226,10 +226,12 @@ class Player(StrMixin):
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment