
Feb. 28, 2011
6:27 p.m.
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? Cheers, Dirkjan