'Returns True if self is more specific than other_handler.
Priority in determining specificity is first determined by literal-ness,
second by length. This is according to the Java servlet spec for
mapping URL paths.
Args:
other_handler: another handler to compare against.
Returns:
True if self.pattern is a literal and other_handler.pattern is not,
False if vice versa, and otherwise True if self.pattern is longer.'

def HasMoreSpecificPatternThan(self, other_handler):

    if (self.is_literal != other_handler.is_literal):
        return self.is_literal
    return (len(self.pattern) > len(other_handler.pattern))
