Skip to content

Commit 1833117

Browse files
author
Gauvain Pocentek
committed
Implement __repr__ for gitlab objects
Fix #114
1 parent 7cfbe87 commit 1833117

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gitlab/objects.py

+5
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,11 @@ def __getattr__(self, name):
424424
def __str__(self):
425425
return '%s => %s' % (type(self), str(self.__dict__))
426426

427+
def __repr__(self):
428+
return '<%s %s:%s>' % (self.__class__.__name__,
429+
self.idAttr,
430+
getattr(self, self.idAttr))
431+
427432
def display(self, pretty):
428433
if pretty:
429434
self.pretty_print()

0 commit comments

Comments
 (0)