Permalink
Browse files

Merge pull request #627 from jparise/urlspec-repr

Add a helpful __repr__ implementation to URLSpec.
  • Loading branch information...
2 parents 465f572 + b27c54c commit 5f597b58a26c4f32dcfe9dd46f9fd68bba2f6ea1 @bdarnell bdarnell committed Nov 11, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 tornado/web.py
View
@@ -2002,6 +2002,11 @@ def __init__(self, pattern, handler_class, kwargs=None, name=None):
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.

0 comments on commit 5f597b5

Please sign in to comment.