def _HandleCommonSuffix(first_handler, second_handler, common_suffix):
 stripped_first_handler = SimpleHandler(first_handler.pattern[:(- len(common_suffix))], first_handler.properties)
 stripped_second_handler = SimpleHandler(second_handler.pattern[:(- len(common_suffix))], second_handler.properties)
 stripped_handlers = _IntersectTwoHandlers(stripped_first_handler, stripped_second_handler)
 handlers = set()
 for stripped_handler in stripped_handlers:
  handlers.add(SimpleHandler((stripped_handler.pattern + common_suffix), stripped_handler.properties))
 return handlers

def _HandleCommonSuffix ( first_handler , second_handler , common_suffix ) : stripped_first_handler = SimpleHandler ( first_handler . pattern [ : ( - len ( common_suffix ) ) ] , first_handler . properties ) stripped_second_handler = SimpleHandler ( second_handler . pattern [ : ( - len ( common_suffix ) ) ] , second_handler . properties ) stripped_handlers = _IntersectTwoHandlers ( stripped_first_handler , stripped_second_handler ) handlers = set ( ) for stripped_handler in stripped_handlers : handlers . add ( SimpleHandler ( ( stripped_handler . pattern + common_suffix ) , stripped_handler . properties ) ) return handlers
strips matching suffix from handlers and intersects the substrings .