3 ms·
If I recall, writing no boilerplate code was a big deal in python once... And while 2 lines are not worth my rant, writing those 2 lines again and again all th
by keyme 13y ago
If I recall, writing no boilerplate code was a big deal in python once...
And while 2 lines are not worth my rant, writing those 2 lines again and again all the time, is.
- baq 13y agoi'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.