I am trying to understand string representation in python 3. I've seen various explanations on the site, and from the book learning python by Mark Lutz that in python 3, str objects are stored as Unicode code points. Quoting the book, "non-Unicode code sequences are sequences of 8 bit bytes that print with ASCII characters when possible, and Unicode strings are sequences of Unicode code points".
I understand the first part of the quote above, but I don't quite understand the second. How can a sequence of characters, such as when I type S = 'spam' into the console, be stored as 'Unicode code points'?
I believe code points are just numbers that correspond to characters, however the actual encoding that takes you from this number to binary representation depends on the system you choose to use, such as utf-8 or utf-32 . If this is true (please correct me if its not!), then in order for my variable S to be saved to memory, the computer must at some point convert 'spam' into some sequence of bytes. So I go from some characters to a binary for, which is a form of encoding? I have seen another post where it was explained that python does not do its own encoding.
I don't understand then how my variable S could be saved to memory without undergoing some form of encoding (not just storing the data as code points as the book explains)?
Thanks in advance.