Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: new mypyc primitive for weakref.ref #19099

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

Open
wants to merge 28 commits into
base: master
Choose a base branch
Loading
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6b28f17
feat: new primitive for weakref.ref
BobTheBuidler May 23, 2025
8d41c26
fix(test): fix test ref
BobTheBuidler May 23, 2025
97f9186
fix(test): only test with callback
BobTheBuidler May 23, 2025
81eadfb
Update run-weakref.test
BobTheBuidler May 23, 2025
50b9597
Merge branch 'master' into patch-3
BobTheBuidler May 30, 2025
f780828
Merge branch 'master' into patch-3
BobTheBuidler May 30, 2025
8ca882c
Merge branch 'master' into patch-3
BobTheBuidler May 31, 2025
67bcf4b
Merge branch 'master' into patch-3
BobTheBuidler Jun 2, 2025
b05d220
Merge branch 'master' into patch-3
BobTheBuidler Jun 2, 2025
1ae55e4
feat: add primitive for weakref.ref with 1 arg
BobTheBuidler Jun 2, 2025
216df5e
Update irbuild-weakref.test
BobTheBuidler Jun 2, 2025
180c98c
Update run-weakref.test
BobTheBuidler Jun 2, 2025
e0b20f5
Update irbuild-weakref.test
BobTheBuidler Jun 2, 2025
c0f9bd2
Update irbuild-weakref.test
BobTheBuidler Jun 2, 2025
975d91a
Merge branch 'master' into patch-3
BobTheBuidler Jun 3, 2025
83cb39f
Update weakref_ops.py
BobTheBuidler Jun 3, 2025
9e1375d
Update weakref_ops.py
BobTheBuidler Jun 3, 2025
6ec984e
Merge branch 'master' into patch-3
BobTheBuidler Jun 3, 2025
a15838c
Merge branch 'master' into patch-3
BobTheBuidler Jun 3, 2025
1da9046
Merge branch 'master' into patch-3
BobTheBuidler Jun 4, 2025
ec5d4c6
Merge branch 'master' into patch-3
BobTheBuidler Jun 5, 2025
806a27d
Merge branch 'master' into patch-3
BobTheBuidler Jun 5, 2025
34e2f74
Merge branch 'master' into patch-3
BobTheBuidler Jun 7, 2025
a4bb497
Merge branch 'master' into patch-3
BobTheBuidler Jun 8, 2025
0ff5841
Merge branch 'master' into patch-3
BobTheBuidler Jun 17, 2025
fd5bf8b
Merge branch 'master' into patch-3
BobTheBuidler Jun 21, 2025
4698a87
Merge branch 'master' into patch-3
BobTheBuidler Jun 22, 2025
986947a
Merge branch 'master' into patch-3
BobTheBuidler Jun 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(test): fix test ref
  • Loading branch information
BobTheBuidler committed May 23, 2025
commit 8d41c269b345c651d76a56f10bd213f648662e44
11 changes: 7 additions & 4 deletions 11 mypyc/test-data/run-weakref.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ import asyncio
import pytest # type: ignore [import-not-found]
from weakref import ref

@mypyc_attr(native_class=False)
class Object:
"""some random weakreffable object"""
pass

def test_weakref_ref():
# some random weakreffable object
obj = asyncio.new_event_loop()
obj = Object()
r = ref(obj)
assert r() is obj
obj = None
assert r() is None, r()

def test_weakref_ref_with_callback():
# some random weakreffable object
obj = asyncio.new_event_loop()
obj = Object()
r = ref(obj, lambda x: x)
assert r() is obj
obj = None
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.