Possible talking point (feel free to edit adding information).
I have just written this test to verify empirically what the answer to the question might be (this cannot and does not want to be a certain answer).
import sys
a = "abcdefg"
print("a id:", id(a))
print("a[2:] id:", id(a[2:]))
print("a[2:] is a:", a[2:] is a)
print("Empty string memory size:", sys.getsizeof(""))
print("a memory size:", sys.getsizeof(a))
print("a[2:] memory size:", sys.getsizeof(a[2:]))
Output:
a id: 139796109961712
a[2:] id: 139796109962160
a[2:] is a: False
Empty string memory size: 49
a memory size: 56
a[2:] memory size: 54
As we can see here:
- the size of an empty string object is 49 bytes
- a single character occupies 1 byte (Latin-1 encoding)
a
and a[2:]
ids are different
- the occupied memory of each
a
and a[2:]
is consistent with the memory occupied by a string with that number of char assigned