I am reading a book Fluent Python by Luciano Ramalho published by O'Reilly. In chapter two the author presents an interesting statement defining container sequences and flat sequences.
Container sequences: list, tuple, and collections.deque can hold items of different types.
Flat sequences: str, bytes, bytearray, memoryview, and array.array hold items of one type.
and then he goes on saying that:-
Container sequences hold references to the objects they contain, which may be of any type, while flat sequences physically store the value of each item within its own memory space, and not as distinct objects. Thus, flat sequences are more compact, but they are limited to holding primitive values like characters, bytes, and numbers.*
This got me thinking that if lists store references to the objects they are storing, in what way does a flat sequence like an array store values of its elements? The author says that the flat sequence physically stores the value of each item. what does he mean by that?
This is my first time asking question. Please excuse my lack of knowledge in this area.