Kevin Hendricks added the comment:

Thanks for letting me know this was expected behaviour.  I see the same "issue" 
holds true while using:

for c in b'0123456789':
   print(ord(c))
 
I ended up using slices nearly everyplace.  Still ran into iterator issues.  
Horrible hack really.  

I think I will spend some time reading the python dev archives to figure out 
how anyone could defend this approach.

FWIW, introducing a bytes class that works exactly like byte (non-unicode 
strings) in python 2.X but disallowing any automatic up-conversion to full 
unicode (like during concatenation), would have been a useful step.  

I work on decoding binary formatted ebook files all of the time, and python 3's 
second class treatment of bytes makes no sense to me.  Perfectly valid code can 
be written using only utf-8 and latin-1 encoded bytestrings with no need to 
upconvert to anything.  It is practically impossible to support code like that 
in Python 3.

Boggles the mind.

Thanks again for the fast response.

Kevin

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22549>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to