News for hackers. Stuff that matters.
Re:A viable solution for Python concurrency by dagenix on Friday October 15, 2021 @07:55PM (#28884423)
IMO, it's a good thing that decode() doesn't on strings in Python 3.
Re:A viable solution for Python concurrency by throwaway81523 on Friday October 15, 2021 @08:10PM (#28884516)
There is a case to be made either way. The point is that it's yet another quirky difference that pops up sometimes, and using python3 keeps bringing up a stream of such issues.

It does seem in the spirit of Python's duck typing to be able to say '616263'.decode('hex') and get 'abc', and that does work fine in py2. Try it in py3 and you get a type error. So ok, convert the string to bytes, e.g. by saying b'616263' instead of '616263'. That doesn't work either, but I'll leave the experiment to you.

Re:A viable solution for Python concurrency by adwn on Saturday October 16, 2021 @02:21AM (#28885941)
So, like this?

    codecs.decode(b'616263', 'hex')
If that's correct, what's so hard/bad about this?