I hope iI can make a useful supplement to this question, if. If your list storestores a specific type object, for example Info, Herehere is a situation that extend method is not suitable,: In a forfor loop and and generate a Infogenerating an Info object every time and using extendextend to store it into your list, it will failed,fail. The exception is like below:
TypeError: 'Info' object is not iterable
TypeError: 'Info' object is not iterable
butBut if you use the append method, the result is OK. Because every time using extendthe extend method, it will always treat it as a list or any othersother collection type and, iterate it, and place it after the previous list.Specific A specific object can not be iterated, obviously.