### Description This error came up in https://github.com/pymc-devs/pymc-extras/pull/542. It is caused by `PointFunc` recursively trying to access `self.f` during unpickling. MWE: ```py import pymc as pm with pm.Model() as m: x = pm.Categorical('x', logit_p=[1., 1., 1., 1.])) idata = pm.sample(step=pm.CategoricalGibbsMetropolis([x]), mp_ctx='spawn') ``` A simple fix would add a check that f has been set inside `PointFunc.__getattr__`