[Guido] > Good idea [using string.encode()]! This could also be used to > "hexify" a string, for which currently one of the quickest ways > is still the hack > > "%02x"*len(s) % tuple(s) Note that as of 2.0, a far quicker way is to use binascii.b2a_hex(), or its absurdist (read "Barry" <wink>) synonym binascii.hexlify(). I'm wary of using string.encode() for this, because one normally hexlifies binary data (e.g., like sha checksums), and 4 days of 7 we're more than not in favor of moving away from strings to carry binary data. Of course we can change our minds about this across releases, and have even-numbered releases deprecate the function forms while odd-numbered ones abjure methods. Works for me <wink>.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4