-
-
Notifications
You must be signed in to change notification settings - Fork 3k
feat: new mypyc primitives for weakref.proxy #19217
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
base: master
Are you sure you want to change the base?
Conversation
0247068
to
c14c3a4
Compare
c14c3a4
to
c7608fb
Compare
5117b20
to
834e739
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Tests are fixed, this PR is now ready for review. |
for more information, see https://pre-commit.ci
6bde2ab
to
652de32
Compare
Thanks for the feedbacks, I've addressed all of them and this PR is again ready for review. |
Hmm.. what happened here? the testutil import broke the tests? |
@JukkaL any idea why replacing its another typeshed thing? |
class list: ... | ||
class BaseException: ... | ||
class Exception(BaseException): ... | ||
class ReferenceError(Exception): ... |
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.
This fixture is probably causing the problems -- some of these definitions are too simplified (or missing). If ReferenceError
is the only new thing you need here, what about adding it to the generic ir.py
?
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.
Ah, I saw a comment somewhere indicating not to add things to that file as it would slow down the whole suite.
No worries, I've updated the PR accordingly and the tests pass now.
This PR adds 2 new weakref primitives for weakref.proxy (1 and 2 arg)
The C code generates correctly, but I'm not entirely sure why this test is failing. The weakly-proxied object is being destroyed too early, while there should still be a strong reference to it. It also fails if we use the builtin weakref.proxy, so I believe this might be exposing a reference counting bug unrelated to this PR.