Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
[Bruce] > but try this, and it will NOT work: > > FatThing= [(5, 4, "First Place"), > (6, 6, "Fifer Place"), > (2, 2, "Slowr Place")] > print(FatThing) #this works > > FFThing = FatThing + ('22', '32', '55') #this causes an error! That is correct, it should cause an error because you are trying to concatenate a list and a tuple. This is an easier way to show the same behaviour: [] + () # fails with TypeError [Bruce] > however if you change all the members to strings, it will work!!! I'm afraid you are mistaken. It still fails, as it should. py> FatThing = [("a", "b", "First Place"), ... ("c", "d", "Fifer Place"), ... ("e", "f", "Slowr Place")] py> FFThing = FatThing + ('22', '32', '55') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate list (not "tuple") to list Please take more care when trying to report what you think is a bug. Remember that Python is about 30 years old and there are tens or hundreds of thousands of people using it every single day. 99% of the time, anything you, or I, find that looks like a bug, is a bug in *our* code, not Python. Especially when it is something as basic and fundamental as tuple concatenation. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39641> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com