diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-10-16 20:56:46 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-10-16 20:56:46 -0700 |
commit | 5a07892bfc58472c1b651f66deaf03176bfe79df (patch) | |
tree | 6b6a7f449721c3b3515c9ae36e5be03b610c7967 /netlib/encoding.py | |
parent | 3fbce7e981cab5d20b3ef17a50f14b34e8c60fa3 (diff) | |
download | mitmproxy-5a07892bfc58472c1b651f66deaf03176bfe79df.tar.gz mitmproxy-5a07892bfc58472c1b651f66deaf03176bfe79df.tar.bz2 mitmproxy-5a07892bfc58472c1b651f66deaf03176bfe79df.zip |
py2--: inline type info
Diffstat (limited to 'netlib/encoding.py')
-rw-r--r-- | netlib/encoding.py | 8 |
1 files changed, 3 insertions, 5 deletions
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 |