Skip to content

Commit a38ddf1

Browse files
committed
feat: support_weakrefs=True in mypyc_attr
1 parent 58870d2 commit a38ddf1

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
@@ -326,6 +326,9 @@ def prepare_class_def(
326326
if attrs.get("serializable") is True:
327327
# Supports copy.copy and pickle (including subclasses)
328328
ir._serializable = True
329+
if attrs.get("support_weakrefs") is True:
330+
# Supports weakrefs (including subclasses)
331+
ir.support_weakrefs = True
329332

330333
# Check for subclassing from builtin types
331334
for cls in info.mro:

0 commit comments

Comments
 (0)