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
Add ports #403
Conversation
Pull Request Test Coverage Report for Build 1811
💛 - Coveralls |
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.
LGTM, the only concern I have would be that this keeps instance objects around indefinitely so long as the class is alive because it maintains a reference. I think Python's weakref
would allow us to mitigate this issue: https://docs.python.org/3/library/weakref.html
@rsetaluri what do you think about improving the logic to use weakref? I thought about it more, and this is mainly an issue when we add the notion of deleting instances (because then the class will hold the remaining reference), but in theory it could still manifest in the current code when a Circuit object goes out of scope (it will get destructed, releasing it's reference to it's placed instances, however those placed instances won't get cleaned up because their definition class still maintains a reference to them). |
This is stale. We will revisit this feature in the future properly. |
TODO: add tests