Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add a helpful __repr__ implementation to URLSpec. #627

merged 1 commit into from

2 participants


This makes it quite a bit easier to debug lists of URLSpec-based handlers.

@bdarnell bdarnell merged commit 5f597b5 into tornadoweb:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 7, 2012
  1. @jparise
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 tornado/
5 tornado/
@@ -2002,6 +2002,11 @@ def __init__(self, pattern, handler_class, kwargs=None, name=None): = 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,
def _find_groups(self):
"""Returns a tuple (reverse string, group count) for a url.
Something went wrong with that request. Please try again.