R. David Murray added the comment:

I said *enough* motivation.  doing b'x'.join(b'anything') is a very uncommon 
operation (as is the equivalent string case).

There is no parallel to the bytearray constructor, since that constructor does 
not take an iterable of byte-like objects as its input, it takes an iterable of 
ints, as you point out.  There is no parallel to slice assignment, since a 
slice is by definition a bytes like object (that's why using the slice notation 
in the comprehension to the argument of join works).

The inconsistency is entirely a consequence of the fact that if you iterate a 
bytes-like object you get integers.  So, join's behavior is consistent with 
that, and as I said, *I* don't see enough motivation to make a special case 
exception here.  Others may disagree.

----------

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

Reply via email to