In python class attributes are inherited, but the inheritance mechanism is not fully in effect when Python is resolving names during the execution of the child class's body.
Python follows a specific search path for the name CONF_CONST_POWER:
Step 1: It checks for local variables or attributes being defined right now. It doesn't find CONF_CONST_POWER.
Step 2: Because LightSchema is nested, it checks the scope of SwitchSchema. However, CONF_CONST_POWER is an attribute of the SwitchSchema class, not a variable in its execution scope.
Step 3 is a search in the global scopebut it's not there either.
To access an attribute from the parent class during the child class's definition, you must explicitly reference the parent class name.