In this example, the Color
class objects don't have such attribute.
What's happening here is that you are creating those attribute, which could then be used. Apparently, python being dynamic and stuff allows such a thing.
If we see objects as arrays of values and references, what you'd be doing here is appending another value (or reference) to the current object.
I did a quick and dirty example using this online interpreter :
from enum import Enum
class names(Enum):
Paul=1
Robert=2,
Jean=3,
Charles=4
names.Paul.price = 25
print(names.Paul.price) # works, as we just added the price poperty.
print(isinstance(names.Paul, names)) # returns true, we don't lose property.
print(names.Robert.price) # AttributeError, we didn't add it.