Skip to content

Commit ca1cfc8

Browse files
committed
Use __str__ for __repr__ as we did before.
1 parent 1cd5794 commit ca1cfc8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sc2reader/objects.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ def __init__(self, sid, slot_data, uid, init_data, pid):
260260
def __str__(self):
261261
return "Observer {0} - {1}".format(self.uid, self.name)
262262

263+
def __repr__(self):
264+
return str(self)
265+
263266

264267
class Computer(Entity, Player):
265268
""" Extends :class:`Entity` and :class:`Player`
@@ -280,6 +283,9 @@ def __init__(self, sid, slot_data, pid, detail_data, attribute_data):
280283
def __str__(self):
281284
return "Player {0} - {1} ({2})".format(self.pid, self.name, self.play_race)
282285

286+
def __repr__(self):
287+
return str(self)
288+
283289

284290
class Participant(Entity, User, Player):
285291
""" Extends :class:`Entity`, :class:`User`, and :class:`Player`
@@ -300,6 +306,9 @@ def __init__(self, sid, slot_data, uid, init_data, pid, detail_data, attribute_d
300306
def __str__(self):
301307
return "Player {0} - {1} ({2})".format(self.pid, self.name, self.play_race)
302308

309+
def __repr__(self):
310+
return str(self)
311+
303312

304313
class PlayerSummary():
305314
"""

0 commit comments

Comments
 (0)