First of all, this guide is just right. You can use tuples for homogeneous data and lists for heterogeneous data, and there may be times when this is great. One important case is if you need a hash collection so that you can use it as a dictionary key; in this case you should use a tuple, even if all the elements are uniform in nature.
Also note that the homogeneous / heterogeneous distinction really applies to the semantics of the data, not just the types. The sequence of name, profession and address is likely to be considered heterogeneous, although all three can be represented as strings. Therefore, it is more important to think about what you are going to do with the data (i.e., will you really treat the elements the same way) than what they are.
However, I think one list of reasons is preferable for homogeneous data because it is mutable. If you have a list of several things of the same type, it may make sense to add another to the list or remove it; when you do this, you still have a list of things of the same type.
In contrast, if you have a collection of dissimilar varieties, this is usually because you have a fixed structure or “scheme” for them (for example, the first is an identification number, the second is a name, the third is an address or something yet). In this case, it makes no sense to add or remove an element from the collection, because the collection is an integrated whole with the specified roles for each element. You cannot add an element without changing the entire layout for what the elements represent.
In short, dimensional changes are more natural for homogeneous collections than for heterogeneous collections, so volatile types are more natural for homogeneous collections.
source share