From 2bfa558107e9ab7c3e2ccfdec098a62dafae5784 Mon Sep 17 00:00:00 2001 From: Ben Kiel Date: Thu, 3 Oct 2024 17:20:17 -0500 Subject: [PATCH] Update base.py (#750) --- Lib/fontParts/base/base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Lib/fontParts/base/base.py b/Lib/fontParts/base/base.py index edc7b46b..abba04f5 100644 --- a/Lib/fontParts/base/base.py +++ b/Lib/fontParts/base/base.py @@ -830,8 +830,14 @@ def _setIdentifier(self, value): def reference(obj): - # import weakref - # return weakref.ref(obj) + """ + This code returns a simple function that returns the given object. + This is a backwards compatibility function that is under review. + See #749. We used to use weak references, but they proved + problematic (see issue #71), so this function was put in place to + make sure existing code continued to function. The need for it is + questionable, so it may be deleted soon. + """ def wrapper(): return obj return wrapper