title: Is a Python list the same list as defined by my data structures and algorithms textbook?
body: <p>I am reading a book about data structures and basic algorithms to get a better grasp on programming. The book I am reading defines some data structures, e.g. list, array, etc, and specifies the interfaces to these, and also how they can be implemented (or constructed) using existing data structures in different languages. For example, it discusses how a list can be constructed as an array or as linked cells.</p>
  
  <p>However, when I start looking at these data types in different languages I find that they do not always follow the interfaces that are defined in the book. </p>
  
  <p>For example, the book says that in a list you should be able to step through the different elements one at the time, starting only at one of the ends. For example, if I want the third element, I would have to start with the first element and use a "next" operation until I get to the element I want. But lists in Python have integer indices and I can directly access any element directly by using the corresponding index. In the book, the index type only has to be an ordered type with a comparison operation for equality. (I think the book tries to stay general by abstracting things).</p>
  
  <p>Does this mean that Python's lists are not lists in the "true sense"? Or is it that the data structures defined in the book are only suggestions on how the interfaces for these can look, and in practice there can be a lot of variation?</p>
  
  <p>I understand that the idea about the book is to get a better understanding for how to think about data structures, and to introduce some typical ones, so I am inclined to think that the latter answer is the correct one.</p>