Skip to content
Myr

Make add_url_rule() signature consistent

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This caused a mypy error when I was making another typing improvement, so I am fixing it before committing my other changes.

authored by Alex Hedges · committed by Phil Jones · parent 0d594b8 · Browse files · 2 files+11 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−2 removed

  • other:+11 added−2 removed

2 files+11 added−2 removed

modified:src/flask/blueprints.py+10 added-1 removed
363 unmodified lines
364 self,365 rule: str,366 endpoint: t.Optional[str] = None,367 view_func: t.Optional[t.Callable] = None,368 provide_automatic_options: t.Optional[bool] = None,369 **options: t.Any,370 ) -> None:371 """Like :meth:`Flask.add_url_rule` but for a blueprint. The endpoint for372 the :func:`url_for` function is prefixed with the name of the blueprint.
3 unmodified lines
376377 if view_func and hasattr(view_func, "__name__") and "." in view_func.__name__:378 raise ValueError("'view_func' name may not contain a dot '.' character.")379379 self.record(lambda s: s.add_url_rule(rule, endpoint, view_func, **options))380 self.record(381 lambda s: s.add_url_rule(382 rule,383 endpoint,384 view_func,385 provide_automatic_options=provide_automatic_options,386 **options,387 )388 )389390 def app_template_filter(self, name: t.Optional[str] = None) -> t.Callable:391 """Register a custom template filter, available application wide. Like392 :meth:`Flask.template_filter` but for a blueprint.
169 unmodified lines
modified:src/flask/scaffold.py+1 added-1 removed
441 unmodified lines
442 endpoint: t.Optional[str] = None,443 view_func: t.Optional[t.Callable] = None,444 provide_automatic_options: t.Optional[bool] = None,445 **options: t.Any,446 ) -> t.Callable:446 ) -> None:447 """Register a rule for routing incoming requests and building448 URLs. The :meth:`route` decorator is a shortcut to call this449 with the ``view_func`` argument. These are equivalent:450
412 unmodified lines