Skip to content
Browse files

Add a helpful __repr__ implementation to URLSpec.

  • Loading branch information...
1 parent 958301d commit b27c54c257efc77cd405b000bf02b82053b72305 @jparise committed
Showing with 5 additions and 0 deletions.
  1. +5 −0 tornado/web.py
View
5 tornado/web.py
@@ -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 b27c54c

Please sign in to comment.
Something went wrong with that request. Please try again.