Repository navigation
Releases
Releases · immijimmi/managedstate
Omitting Specific Defaults
- Added
NO_DEFAULTsentinel value which can be included inside a default values list, and which enables the defaults provided to be only a partial list without specifying a default at every index
No breaking changes.
Race Condition Fix
- Fix to how Registrar modifies
._extension_data(previously, any recursive call to.registered_get/.registered_setwould cause it to attempt to delete the same key twice and throw an exception)
No breaking changes.
KeyQuery Fix
- Exceptions raised during the execution of a KeyQuery are now caught, and the default argument for that path key used.
No breaking changes.
Housekeeping
- Added additional calls to Methods.try_copy() where it is sensible to copy method params before mutating them, or in similar circumstances
(from a user perspective, this means that there should be no mutability gotchas when using this package - any params passed in will have a working copy created to mutate internally, and any return values will also be copies themselves) - Renamed positional params from
methodtomethod_namein Listeners for clarity - Minor improvements to error messages
- Fixes to type hints
- Improvements to docstrings
- Updated readme
- Updated dependency
This release features minor breaking changes in the form of renamed positional params.
Method Deduplication
- Removed local Methods.try_copy(), instead using identical method from objectextensions dependency
This release features breaking changes in the form of the above removed method.
New State.set() Functionality
- State.set() now attempts to populate any list encountered in the state that has insufficient length with copies of the relevant provided default value, in order to store the set value at the desired index
- KeyQuery.history now returns a list rather than a tuple, modify at your own risk
- Added and improved code comments
- Added tests for new functionality
This release features breaking changes in the form of modified behaviour in State.set(), and a modified return value in KeyQuery.history.
Dependency Update
- Updated objectextensions dependency
No breaking changes.
State Shape Generation
- Added Registrar.get_shape(), which uses the current registered paths on the state object to construct a default shape for the purpose of introspection
- Updates to various docstrings, and to the README file
No breaking changes.
Various Minor Refactors
- Edits in comments/docstrings
- KeyQuery now uses Methods.try_copy() rather than running its stored function a second time (no change in expected behaviour)
- Simplified a type hint in KeyQuery
No breaking changes.
Registered Paths Exposure
- try_copy() in state.py moved to new Methods class and exposed in package
- Exposed .registered_paths property on Registrar
- Renamed Registrar.register() to .register_paths(), due to collision with ABC.register() in Extension class.
This release introduces breaking changes for any code that uses the Registrar extension.