diff --git a/kombu/utils/encoding.py b/kombu/utils/encoding.py index 32eb9941..2487e6f5 100644 --- a/kombu/utils/encoding.py +++ b/kombu/utils/encoding.py @@ -45,8 +45,12 @@ else: @overload def str_to_bytes(s: str) -> bytes: ... + + @overload def str_to_bytes(s: T) -> T: ... + + def str_to_bytes(s: Any) -> Any: """Convert str to bytes.""" if isinstance(s, str): @@ -56,8 +60,12 @@ def str_to_bytes(s: Any) -> Any: @overload def bytes_to_str(s: bytes) -> str: ... + + @overload def bytes_to_str(s: T) -> T: ... + + def bytes_to_str(s: Any) -> Any: """Convert bytes to str.""" if isinstance(s, bytes):