From 5a07892bfc58472c1b651f66deaf03176bfe79df Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 16 Oct 2016 20:56:46 -0700 Subject: py2--: inline type info --- netlib/encoding.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'netlib/encoding.py') diff --git a/netlib/encoding.py b/netlib/encoding.py index f0f7381d..a6ae9a96 100644 --- a/netlib/encoding.py +++ b/netlib/encoding.py @@ -11,7 +11,7 @@ import gzip import zlib import brotli -from typing import Union # noqa +from typing import Union # We have a shared single-element cache for encoding and decoding. @@ -22,8 +22,7 @@ CachedDecode = collections.namedtuple("CachedDecode", "encoded encoding errors d _cache = CachedDecode(None, None, None, None) -def decode(encoded, encoding, errors='strict'): - # type: (Union[str, bytes], str, str) -> Union[str, bytes] +def decode(encoded: Union[str, bytes], encoding: str, errors: str='strict') -> Union[str, bytes]: """ Decode the given input object @@ -64,8 +63,7 @@ def decode(encoded, encoding, errors='strict'): )) -def encode(decoded, encoding, errors='strict'): - # type: (Union[str, bytes], str, str) -> Union[str, bytes] +def encode(decoded: Union[str, bytes], encoding: str, errors: str='strict') -> Union[str, bytes]: """ Encode the given input object -- cgit v1.2.3