Fix typing 2
This commit is contained in:
parent
be1c09e7da
commit
0a8ee7be9d
@ -151,11 +151,11 @@ class Blueprint(BaseSanic):
|
|||||||
name: str,
|
name: str,
|
||||||
url_prefix: Optional[Union[str, Default]] = _default,
|
url_prefix: Optional[Union[str, Default]] = _default,
|
||||||
version: Optional[Union[int, str, float, Default]] = _default,
|
version: Optional[Union[int, str, float, Default]] = _default,
|
||||||
version_prefix: Optional[Union[str, Default]] = _default,
|
version_prefix: Union[str, Default] = _default,
|
||||||
strict_slashes: Optional[Union[bool, Default]] = _default,
|
strict_slashes: Optional[Union[bool, Default]] = _default,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Copy a blueprint instance with some optional parameters to
|
Copy a blueprint instance with some optional parameters to
|
||||||
override the values of attributes in the old instance.
|
override the values of attributes in the old instance.
|
||||||
|
|
||||||
:param name: unique name of the blueprint
|
:param name: unique name of the blueprint
|
||||||
@ -168,13 +168,14 @@ class Blueprint(BaseSanic):
|
|||||||
"""
|
"""
|
||||||
new_bp = deepcopy(self)
|
new_bp = deepcopy(self)
|
||||||
new_bp.name = name
|
new_bp.name = name
|
||||||
if url_prefix != _default:
|
|
||||||
|
if not isinstance(url_prefix, Default):
|
||||||
new_bp.url_prefix = url_prefix
|
new_bp.url_prefix = url_prefix
|
||||||
if version != _default:
|
if not isinstance(version, Default):
|
||||||
new_bp.version = version
|
new_bp.version = version
|
||||||
if strict_slashes != _default:
|
if not isinstance(strict_slashes, Default):
|
||||||
new_bp.strict_slashes = strict_slashes
|
new_bp.strict_slashes = strict_slashes
|
||||||
if version_prefix != _default:
|
if not isinstance(version_prefix, Default):
|
||||||
new_bp.version_prefix = version_prefix
|
new_bp.version_prefix = version_prefix
|
||||||
|
|
||||||
return new_bp
|
return new_bp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user