You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scalems.store makes "clever" use of the Python generator protocol to place the main owning reference to the FileStore in the frame of a generator function.
This is done for various reasons that seem insufficient justification for the obscurity of the implementation. (Namely, a generator instance seemed like kind of a handy relocatable context manager that allowed for a finally block.)
We can probably improve readability, maintainability, and simplicity by using a __del__ method or a finalizer callback (ref: the weakref module).
This becomes more relevant as the FileStoreManager gains responsibilities beyond managing that single generator.
There may be other reasons for the original design decision, though, and I don't want to open a fresh can of worms just yet, so this issue is deferred until after the "raptor migration" iteration
The text was updated successfully, but these errors were encountered:
scalems.store
makes "clever" use of the Python generator protocol to place the main owning reference to the FileStore in the frame of a generator function.This is done for various reasons that seem insufficient justification for the obscurity of the implementation. (Namely, a generator instance seemed like kind of a handy relocatable context manager that allowed for a
finally
block.)We can probably improve readability, maintainability, and simplicity by using a
__del__
method or a finalizer callback (ref: theweakref
module).This becomes more relevant as the FileStoreManager gains responsibilities beyond managing that single generator.
There may be other reasons for the original design decision, though, and I don't want to open a fresh can of worms just yet, so this issue is deferred until after the "raptor migration" iteration
The text was updated successfully, but these errors were encountered: