Skip to content

Commit fe6e886

Browse files
committed
address pr comments
1 parent 3b75247 commit fe6e886

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

mahjong/meld.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,16 @@ def __setattr__(self, name: str, value: object) -> None:
114114
del self.__dict__["tiles_34"]
115115

116116
def __str__(self) -> str:
117-
"""Return a human-readable string with meld type and tiles."""
117+
"""
118+
Return a human-readable string with meld type and tiles.
119+
120+
>>> from mahjong.meld import Meld
121+
>>> from mahjong.tile import TilesConverter
122+
>>> tiles = TilesConverter.string_to_136_array(man="123")
123+
>>> meld = Meld(meld_type=Meld.CHI, tiles=tiles)
124+
>>> str(meld)
125+
'Type: chi, Tiles: 123m (0, 4, 8)'
126+
"""
118127
return f"Type: {self.type}, Tiles: {TilesConverter.to_one_line_string(self.tiles)} {self.tiles}"
119128

120129
def __repr__(self) -> str:

0 commit comments

Comments
 (0)