Skip to content

Commit 3b8500b

Browse files
committed
Continued: Allow accessing wrapped function attributes in PointFunc
1 parent cd2e1a3 commit 3b8500b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymc/pytensorf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ def join_nonshared_inputs(
559559
class PointFunc:
560560
"""Wraps so a function so it takes a dict of arguments instead of arguments."""
561561

562+
__slots__ = ("f",)
563+
562564
def __init__(self, f):
563565
self.f = f
564566

@@ -567,8 +569,7 @@ def __call__(self, state):
567569

568570
def __getattr__(self, item):
569571
"""Allow access to the original function attributes."""
570-
if item == "f":
571-
return self.f
572+
# This is only reached if `__getattribute__` fails.
572573
return getattr(self.f, item)
573574

574575

0 commit comments

Comments
 (0)