Re: encode and decode builtins

2014-11-16 Thread dieter
Garrett Berg writes: > ... > However, there are times that I do not care what data I am working with, > and I find myself writing something like: > > if isinstance(data, bytes): data = data.decode() Apparently, below this code, you do care that "data" contains "str" (not "bytes") -- otherwise, yo

Re: encode and decode builtins

2014-11-16 Thread Ned Batchelder
On 11/16/14 2:39 AM, Garrett Berg wrote: I made the switch to python 3 about two months ago, and I have to say I love everything about it, /especially/ the change to using only bytes and str (no more unicode! or... everything is unicode!) As someone who works with embedded devices, it is great to

Re: encode and decode builtins

2014-11-15 Thread Ben Finney
Garrett Berg writes: > I made the switch to python 3 about two months ago, and I have to say > I love everything about it, *especially* the change to using only > bytes and str (no more unicode! or... everything is unicode!) As > someone who works with embedded devices, it is great to know what d

encode and decode builtins

2014-11-15 Thread Garrett Berg
I made the switch to python 3 about two months ago, and I have to say I love everything about it, *especially* the change to using only bytes and str (no more unicode! or... everything is unicode!) As someone who works with embedded devices, it is great to know what data I am working with. However