I see existing issues related to specific programming languages. There are differences in the implementation in specific languages, but is there a theoretical conceptual difference?
Mutable vs immutable . In Python, lists are completely mutable, and tuples are immutable or permanently immutable, so modifications make new tuples and don't make modifications. But this is just an implementation detail. In other languages, tuples are mutable and lists are immutable.
Heterogeneous vs homogeneous . Semantically, tuples are usually heterogeneous, and lists are usually uniform, but this is more of an agreement, and there are many exceptions. Dynamically typed languages ββlike Python have heterogeneous lists. For example, Haskell supports fully statically typed heterogeneous lists called HList.
Finite and infinite . Theoretically, a list can be infinite, and some programming languages ββ(Haskell) support infinite lists. A tuple cannot be infinite.
UPDATE . The only theoretical difference is that the tuple should be finite, and the list could theoretically be infinite. Other differences are pure differences in implementation.
Wikipedia says: βA tuple is a finite ordered list of elements.β
This makes it clear that a tuple is a list, but an end list.
source share