From 1488a033ccfd4befe2c43d6713949d557a451f23 Mon Sep 17 00:00:00 2001 From: Ricardo Vieira Date: Thu, 19 Jun 2025 12:04:10 +0200 Subject: [PATCH] Continued: Allow accessing wrapped function attributes in PointFunc --- pymc/pytensorf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pymc/pytensorf.py b/pymc/pytensorf.py index 2b9e4a8b03..f1d69c9282 100644 --- a/pymc/pytensorf.py +++ b/pymc/pytensorf.py @@ -559,6 +559,8 @@ def join_nonshared_inputs( class PointFunc: """Wraps so a function so it takes a dict of arguments instead of arguments.""" + __slots__ = ("f",) + def __init__(self, f): self.f = f @@ -567,8 +569,7 @@ def __call__(self, state): def __getattr__(self, item): """Allow access to the original function attributes.""" - if item == "f": - return self.f + # This is only reached if `__getattribute__` fails. return getattr(self.f, item)