2 ms·
i'd argue this is not boilerplate, more like a shortcut for your particular use case: import codecs enc = lambda x: codecs.encode(x, 'hex') i hav
by baq 13y ago
i'd argue this is not boilerplate, more like a shortcut for your particular use case:
import codecs
enc = lambda x: codecs.encode(x, 'hex')
i have a program in python 2 that uses this approach, because i have a lot of decoding from utf and encoding to a different charset to do. python 3 is absolutely the same for me.