How to tell the difference between string and list

John J. Lee jjl at pobox.com
Fri Dec 5 15:24:02 EST 2003


bokr at oz.net (Bengt Richter) writes:
[...]
>  >>> s2 = ['abc','def']
[...]>
>  >>> s2 += 'ghi'
>  >>> s2
>  ['abc', 'def', 'g', 'h', 'i']

That's not what the code I posted tests for.

And the fact that having a+b not raise TypeError breaks that function
seems to me to be a good reason not to do that.


John




More information about the Python-list mailing list