Skip to content

Commit 211ea3c

Browse files
feat: support_weakrefs=True in mypyc_attr
1 parent 85b07d5 commit 211ea3c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypyc/irbuild/prepare.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ def prepare_class_def(
280280
if attrs.get("serializable") is True:
281281
# Supports copy.copy and pickle (including subclasses)
282282
ir._serializable = True
283+
if attrs.get("support_weakrefs") is True:
284+
# Supports weakrefs (including subclasses)
285+
ir.support_weakrefs = True
283286

284287
# Check for subclassing from builtin types
285288
for cls in info.mro:

0 commit comments

Comments
 (0)