how python stores strings in memory the prior section' encodings really only apply when text is stored or transferred externallyin files and other mediums in memorypython always stores decoded text strings in an encoding-neutral formatwhich may or may not use multiple bytes for each character all text processing occurs in this uniform internal format text is translated to and from an encoding-specific format only when it is transferred to or from external text filesbyte stringsor apis with specific encoding requirements once in memorythoughstrings have no encoding they are just the string object presented in this book though irrelevant to your codeit may help some readers to make this more tangible the way python actually stores text in memory is prone to change over timeand in fact mutated substantially as of python and earlier through python strings are stored internally in fixed-length utf- (roughlyucs- format with bytes per characterunless python is configured to use bytes per character (ucs- python and later python and later instead use variable-length scheme with or bytes per characterdepending on string' content the size is chosen based upon the character with the largest unicode ordinal value in the represented string this scheme allows space-efficient representation in common casesbut also allows for full ucs- on all platforms python ' new scheme is an optimizationespecially compared to former wide unicode builds per python documentationmemory footprint is divided by to depending on the textencoding an ascii string to utf- doesn' need to encode characters anymorebecause its ascii and utf- representations are the samerepeating single ascii letter and getting substring of an ascii strings is times fasterutf- is to times fasterand utf- encoding is up to times faster on some benchmarkspython ' overall memory usage is to times smaller than and similar to the less unicode-centric regardless of the storage scheme usedas noted in unicode clearly requires us to think of strings in terms of charactersinstead of bytes this may be bigger hurdle for programmers accustomed to the simpler ascii-only world where each character mapped to single bytebut that idea no longer appliesin terms of both the results of text string tools and physical character sizetext tools todayboth string content and length really correspond to unicode code points-identifying ordinal numbers for characters for instancethe built-in ord function now returns character' unicode code point ordinalwhich is not necessarily an ascii codeand which may or may not fit in single -bit byte' value similarly unicode and byte strings