-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support observe("name:items") for ExtensionPoint [Requires Traits 6.1] (
#354) * Support @observe("name:items") for ExtensionPoint This is achieved by caching the value of ExtensionPoint and make it impossible to mutate the list directly. * Make sure an object with ExtensionPoint is garbage collectable after disconnecting listeners * Clean up test and add docstring * Remove reference back to the object The reference only serves to support some edge cases where the extension point values become out-of-sync because the listeners are not connected yet. Once the listeners are connected the values are refreshed. So all in all it is not worth keeping the reference, as one will then need to use weakref to avoid cycle references, and special handling in the pickling logic to handle that weakref. * Move functions out of ExtensionPoint to avoid cycle reference between listeners and trait types * Fix unpickling ExtensionPointValue in newer versions of Python * Bump traits requirement to 6.1 Co-authored-by: Poruri Sai Rahul <[email protected]>
- Loading branch information
Showing
4 changed files
with
579 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.