On 05/07/2021 09:07, Olaf Hering wrote:
> Am Fri, 2 Jul 2021 18:19:39 +0200
> schrieb Marek Marczykowski-Górecki <[email protected]>:
>
>> Why bytes()? Encode does already return bytes type.
> You are right, this works as well:
>   i = 123
>   b = ("str/%x" % (i, )).encode('utf-8')
>
> Any preference regarding the "encoding"? I picked UTF8, but 'ascii' might be 
> more correct in this context. In practice it may not matter.

I suspect you're right and it doesn't matter, but ascii feels like a
safer option.

~Andrew


Reply via email to