-
-
Notifications
You must be signed in to change notification settings - Fork 79
Turn .param into a property #386
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
Conversation
922882b
to
ec7e668
Compare
|
||
@property | ||
def _BATCH_WATCH(self_): | ||
return self_.self_or_cls._parameters_state['BATCH_WATCH'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To allow .param
to be a property any state that was previously stored on Parameters
now needs to be stored on the Parameterized itself. I didn't want to rock the boat too much so for now I've simply proxied the state that is now on the Parameterized class or instance using these properties. If we want to refactor more then all references to parameterized.param._BATCH_WATCH
, parameterized.param._TRIGGER
, parameterized.param._events
and parameterized.param._watchers
could be updated to refer to the parameterized._parameters_state
instead.
bf3030f
to
6c48d9c
Compare
6c48d9c
to
f639cff
Compare
Looks good. If pickling is working we'll want to merge ASAP to test! |
It is indeed, @jbednar should we merge to start testing? |
I'll merge and tag soon so we can start testing. Can always revert if we find some horrendous regression. |
Supersedes #384
The reasoning behind this is that having accessors which hold a reference back to the Parameterized object create a circular reference which stops CPython's garbage collection from immediately collecting a Parameterized instance when it is no longer referenced by any external object instead having to wait for the next
gc.collect()
cycle.