&gt; You always &quot;encode&quot; something into bytes, and &quot;decode&quot; bytes back into something. There should be exactly two functions, because the functions have different types: &quot;encode&quot; is str -&gt; bytes, &quot;decode&quot; is bytes -&gt; str. Explicit is better than implicit.<p>I&#x27;m not sure &quot;encoding&quot; tells us that the output is bytes.  Surely information can be encoded in other ways.  Names like .to_bytes() and .from_bytes() might have saved a lot of trips to the documentation.