Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mdickinson opened this issue Aug 19, 2022 · 0 comments
Open
Labels
component: documentation Issues related to the Sphinx documentation

Comments

@mdickinson
Copy link
Member

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.

@mdickinson mdickinson added the component: documentation Issues related to the Sphinx documentation label Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: documentation Issues related to the Sphinx documentation
Projects
None yet
Development

No branches or pull requests

1 participant