Since traitlets 5.7.0 a lot more additional stuff happens in the initialisation of a HasTraits class (that is the initialisation of the class itself through its metaclass init()). All traits are assumed to be present already as class attributes and are registered internally in this initialisation. This means if we dynamically add traits to the class in a class decorator, we need reinitialize the class.
Since traitlets 5.7.0 a lot more additional stuff happens in the initialisation of a HasTraits class (that is the initialisation of the class itself through its metaclass init()). All traits are assumed to be present already as class attributes and are registered internally in this initialisation. This means if we dynamically add traits to the class in a class decorator, we need reinitialize the class.