]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add a helpful __repr__ implementation to URLSpec. 627/head
authorJon Parise <jon@indelible.org>
Wed, 7 Nov 2012 00:04:36 +0000 (16:04 -0800)
committerJon Parise <jon@indelible.org>
Wed, 7 Nov 2012 00:04:36 +0000 (16:04 -0800)
tornado/web.py

index 68bf78b1672d398b6164edff2fbe41fc185f9f45..7d179482d1c9d684c0e8ea8f3a4caae596a5c7de 100644 (file)
@@ -2002,6 +2002,11 @@ class URLSpec(object):
         self.name = name
         self._path, self._group_count = self._find_groups()
 
+    def __repr__(self):
+        return '%s(%r, %s, kwargs=%r, name=%r)' % \
+                (self.__class__.__name__, self.regex.pattern,
+                 self.handler_class, self.kwargs, self.name)
+
     def _find_groups(self):
         """Returns a tuple (reverse string, group count) for a url.