summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-27 10:27:17 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 06:41:34 (GMT)
commite8ece754e8dec4f6c71aa60c7fb7652df947475f (patch)
tree2492ef1f786b5f425b8055c9997e0631ce46f9ba
parent7efba769a6fab59ec7767c55025e01a7502f168b (diff)
Hand: use newString() instead of mjStr for __str__ and assertion
-rw-r--r--src/hand.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/hand.py b/src/hand.py
index 9085c9f..f084a48 100644
--- a/src/hand.py
+++ b/src/hand.py
@@ -194,8 +194,7 @@ class Hand(object):
if self.__lastTile:
assert self.__lastTile.isBonus or self.__lastTile in self.tiles, \
- 'lastTile %s is not in hand %s, mjStr=%s' % (
- self.__lastTile, self.string, self.mjStr)
+ 'lastTile %s is not in hand %s' % (self.__lastTile, str(self))
if self.__lastSource == 'k':
assert self.tiles.count(self.__lastTile.exposed) + \
self.tiles.count(self.__lastTile.concealed) == 1, (
@@ -759,9 +758,7 @@ class Hand(object):
def __str__(self):
"""hand as a string"""
- rest = 'REST ' + ''.join(str(x) for x in self.__rest)
- return ' '.join(str(x) for x in (
- self.melds, rest, self.bonusMelds, self.mjStr)).replace(' ', ' ')
+ return self.newString()
def __repr__(self):
"""the default representation"""