From fa23cc0cebbe2e751ff9ac307a895e8cd970cc36 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 4 May 2016 15:26:03 +0200 Subject: [PATCH] Enhance the output of Token.__repr__ a bit in the generated library Change-Id: I039ee57170948c4a8a19e19ecf49df256c434cf8 TN: P428-014 --- langkit/templates/python_api/module_py.mako | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/langkit/templates/python_api/module_py.mako b/langkit/templates/python_api/module_py.mako index 846e91aa7..a3ce9e04e 100644 --- a/langkit/templates/python_api/module_py.mako +++ b/langkit/templates/python_api/module_py.mako @@ -316,7 +316,10 @@ class Token(ctypes.Structure): return self._sloc_range.wrap() def __repr__(self): - return "".format(self.text) + return ''.format( + self.kind, + ' {}'.format(repr(self.text)) if self.text else '' + ) class Sloc(object):