You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defcon uses weakrefs to e.g. keep a reference to parent objects, but:
weakref.proxy could be used instead of weakref.ref, to spare the need for manual dereferencing.
I think weakrefs are not needed, and even that removing them would be a feature. Since version 2 the python GC can track cycles, so circular references only serve to tie object lifetimes, which I think is salutary in the case of parent refs. Consider the following code:
Currently with weakrefs glyph.font would return None, whereas a strong reference would keep the font alive (until both font and glyph no longer have references). If the font's got multiple layers, here you could still access them rather than end up with an orphaned glyph etc.
The text was updated successfully, but these errors were encountered:
defcon uses weakrefs to e.g. keep a reference to parent objects, but:
weakref.proxy
could be used instead ofweakref.ref
, to spare the need for manual dereferencing.Currently with weakrefs glyph.font would return None, whereas a strong reference would keep the font alive (until both font and glyph no longer have references). If the font's got multiple layers, here you could still access them rather than end up with an orphaned glyph etc.
The text was updated successfully, but these errors were encountered: