Changed the finalizer function for __type_dict#217
Merged
Conversation
This is a temporary quickfix, until __type_dict is pruned from the codebase. The need for this change is due to serialization of baseobjects creating temprorary objects. When the temp objects are finally GC'd, their name in the _store dict might be already taken by an actual (not a temporary) Parameter. GC then calls the the __type_dict's finalizer. In the old solution it was the prune method, which removes the key from __type_dict as well as _store (which might be an actual Parameter by that time). The new solution provides a method to delete keys only from the __type_dict, since removing keys from _store might affect actual Parameters and since _store is a weakref dict anyway.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #217 +/- ##
===========================================
+ Coverage 81.11% 81.13% +0.01%
===========================================
Files 52 52
Lines 4274 4277 +3
Branches 740 741 +1
===========================================
+ Hits 3467 3470 +3
Misses 627 627
Partials 180 180
Flags with carried forward coverage won't be shown. Click here to find out more.
|
damskii9992
approved these changes
Feb 18, 2026
Contributor
damskii9992
left a comment
There was a problem hiding this comment.
Yes, lets get this fucker merged!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a temporary quickfix, until __type_dict is pruned from the codebase. The need for this change is due to serialization of baseobjects creating temprorary objects. When the temp objects are finally GC'd, their name in the _store dict might be already taken by an actual (not a temporary) Parameter. GC then calls the the __type_dict's finalizer. In the old solution it was the prune method, which removes the key from __type_dict as well as _store (which might be an actual Parameter by that time). The new solution provides a method to delete keys only from the __type_dict, since removing keys from _store might affect actual Parameters and since _store is a weakref dict anyway.