'Constructs a Rule instance.
:arg Matcher matcher: a `Matcher` instance used for determining
whether the rule should be considered a match for a specific
request.
:arg target: a Rule\'s target (typically a ``RequestHandler`` or
`~.httputil.HTTPServerConnectionDelegate` subclass or even a nested `Router`,
depending on routing implementation).
:arg dict target_kwargs: a dict of parameters that can be useful
at the moment of target instantiation (for example, ``status_code``
for a ``RequestHandler`` subclass). They end up in
``target_params[\'target_kwargs\']`` of `RuleRouter.get_target_delegate`
method.
:arg str name: the name of the rule that can be used to find it
in `ReversibleRouter.reverse_url` implementation.'

def __init__(self, matcher, target, target_kwargs=None, name=None):

    if isinstance(target, str):
        target = import_object(target)
    self.matcher = matcher
    self.target = target
    self.target_kwargs = (target_kwargs if target_kwargs else {})
    self.name = name
