MCPcopy Create free account
hub / github.com/EasyIME/PIME / __init__

Method __init__

python/python3/tornado/routing.py:657–686  ·  view source on GitHub ↗

Parameters: * ``pattern``: Regular expression to be matched. Any capturing groups in the regex will be passed in to the handler's get/post/etc methods as arguments (by keyword if named, by position if unnamed. Named and unnamed capturing groups may no

(
        self,
        pattern: Union[str, Pattern],
        handler: Any,
        kwargs: Optional[Dict[str, Any]] = None,
        name: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

655 """
656
657 def __init__(
658 self,
659 pattern: Union[str, Pattern],
660 handler: Any,
661 kwargs: Optional[Dict[str, Any]] = None,
662 name: Optional[str] = None,
663 ) -> None:
664 """Parameters:
665
666 * ``pattern``: Regular expression to be matched. Any capturing
667 groups in the regex will be passed in to the handler's
668 get/post/etc methods as arguments (by keyword if named, by
669 position if unnamed. Named and unnamed capturing groups
670 may not be mixed in the same rule).
671
672 * ``handler``: `~.web.RequestHandler` subclass to be invoked.
673
674 * ``kwargs`` (optional): A dictionary of additional arguments
675 to be passed to the handler's constructor.
676
677 * ``name`` (optional): A name for this handler. Used by
678 `~.web.Application.reverse_url`.
679
680 """
681 matcher = PathMatches(pattern)
682 super().__init__(matcher, handler, kwargs, name)
683
684 self.regex = matcher.regex
685 self.handler_class = self.target
686 self.kwargs = kwargs
687
688 def __repr__(self) -> str:
689 return "%s(%r, %s, kwargs=%r, name=%r)" % (

Callers

nothing calls this directly

Calls 2

PathMatchesClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected