Add spacing between `@overload`'ed functions to fix E302 errors

This commit is contained in:
Harry Lees 2024-12-20 14:43:18 +00:00
parent a7ee273569
commit 4f51694275
1 changed files with 8 additions and 0 deletions

View File

@ -45,8 +45,12 @@ else:
@overload @overload
def str_to_bytes(s: str) -> bytes: ... def str_to_bytes(s: str) -> bytes: ...
@overload @overload
def str_to_bytes(s: T) -> T: ... def str_to_bytes(s: T) -> T: ...
def str_to_bytes(s: Any) -> Any: def str_to_bytes(s: Any) -> Any:
"""Convert str to bytes.""" """Convert str to bytes."""
if isinstance(s, str): if isinstance(s, str):
@ -56,8 +60,12 @@ def str_to_bytes(s: Any) -> Any:
@overload @overload
def bytes_to_str(s: bytes) -> str: ... def bytes_to_str(s: bytes) -> str: ...
@overload @overload
def bytes_to_str(s: T) -> T: ... def bytes_to_str(s: T) -> T: ...
def bytes_to_str(s: Any) -> Any: def bytes_to_str(s: Any) -> Any:
"""Convert bytes to str.""" """Convert bytes to str."""
if isinstance(s, bytes): if isinstance(s, bytes):