traits
traits copied to clipboard
Document that handlers (e.g., `TraitType` subclasses) should be stateless
I've seen a couple of instances recently where projects were trying to store per-object state in a TraitType
instance. That doesn't work, in general: the TraitType
instance is per-class, not per-object.
In the section of the user docs on writing your own TraitType
subclass, it should be made clear that TraitType
instances should be stateless: they shouldn't store per-object state from the HasTraits
objects using them.