[Python-3000] What to do about "".join([b""])?

Adam Hupp adam at hupp.org
Fri Nov 2 13:18:02 CET 2007


On 11/1/07, Guido van Rossum <guido at python.org> wrote:

> The alternative is to uniformly apply str(), which for bytes returns a string of the form
> "b'...'" or "buffer(b'...')" (depending on whether the bytes are
> immutable or not). Given that we killed the exception for "" == b""
> earlier, I'm tempted to remove the exception. Any opinions to the
> contrary?

+1 on removing bytes-specific behavior from join.  Whatever the
behavior is it should be consistent.

I prefer removing the str call on .join entirely.  Is there any other
string method that implicitly str's it's argument?  I can't think of
any.   If this works I would expect that concatenation also implicitly
converts (ala java).


-- 
Adam Hupp | http://hupp.org/adam/


More information about the Python-3000 mailing list