enthought / enthought/traits

Document that handlers (e.g., `TraitType` subclasses) should be stateless

Open
#1,720 0 comments 0 reactions 0 assignees View on GitHub
component: documentation
Dominant language
Python
Stars
462
Forks
90
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.