Python class that acts like a string or a list depending on the context.