
On Mon, Feb 28, 2011 at 9:27 AM, Dirkjan Ochtman <dirkjan@ochtman.nl> wrote:
I just saw someone mention this on Twitter, and I know that I've been bitten by it before. Seems like it wouldn't break any existing code... The worst that could happen is that someone gets nonsensical strings in new code instead of an exception.
', '.join(range(5)) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: sequence item 0: expected string, int found ', '.join(str(i) for i in range(5)) '0, 1, 2, 3, 4'
Has this been discussed before? If not, what would be reasons not to do this?
It comes up occasionally and is aways rejected on the same grounds as rejecting '1' + 2. I.e., we believe that the current approach catches more bugs. -- --Guido van Rossum (python.org/~guido)