&gt; &quot;\x01\x02&quot;.encode(&#x27;zlib&#x27;) is a really odd API. Just making sure: this is a real thing, and you&#x27;re in favor of it?<p>Of course this is a real thing and it&#x27;s very frequently used.  Yes I am in favour of it as the codec system in Python is precisely the place where things like this should live.