flask: Add types for cli_group argument to flask.Blueprint (#4011)

* Add types for cli_group argument to flask.Blueprint

* Use private _Sentinel type for default argument to Blueprint cli_group
This commit is contained in:
Razzi Abuissa
2020-05-18 11:58:42 -07:00
committed by GitHub
parent 1f7023b957
commit 949378fdd9

View File

@@ -9,6 +9,8 @@ from typing import Any, Callable, Optional, Type, TypeVar, Union
_T = TypeVar('_T')
_VT = TypeVar('_VT', bound=_ViewFunc)
class _Sentinel(object): ...
class BlueprintSetupState:
app: Any = ...
blueprint: Any = ...
@@ -34,7 +36,8 @@ class Blueprint(_PackageBoundObject):
static_url_path: Optional[str] = ...
deferred_functions: Any = ...
url_values_defaults: Any = ...
def __init__(self, name: str, import_name: str, static_folder: Optional[str] = ..., static_url_path: Optional[str] = ..., template_folder: Optional[str] = ..., url_prefix: Optional[str] = ..., subdomain: Optional[str] = ..., url_defaults: Optional[Any] = ..., root_path: Optional[str] = ...) -> None: ...
cli_group: Union[Optional[str], _Sentinel] = ...
def __init__(self, name: str, import_name: str, static_folder: Optional[str] = ..., static_url_path: Optional[str] = ..., template_folder: Optional[str] = ..., url_prefix: Optional[str] = ..., subdomain: Optional[str] = ..., url_defaults: Optional[Any] = ..., root_path: Optional[str] = ..., cli_group: Union[Optional[str], _Sentinel] = ...) -> None: ...
def record(self, func: Any) -> None: ...
def record_once(self, func: Any): ...
def make_setup_state(self, app: Any, options: Any, first_registration: bool = ...): ...