Gregory P. Smith <g...@krypto.org> added the comment:

FYI - micropython added an optional 'sep' second argument to binascii.hexlify() 
that is a single character separator to insert between every two hex digits.

given the #9951 .hex() methods we have everywhere (and corresponding .fromhex), 
binascii.hexlify is almost a legacy API.  (but micropython doesn't have those 
methods yet).  one key difference?  hexlify returns the hex value as a bytes 
rather than a str.

just adding a couple of parameters to the hex() method seems fine.  a separator 
string and a number of bytes to separate.

yet another minilanguage would be overkill.  and confusing in the face of the 
existing numeric formatting mini language ability to insert , or _ separators 
every four spaces ala f'{value:_x}'.

----------
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.8 -Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue22385>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to