From 87cd36ad4186df01e49e16833e28539ac6d1307f Mon Sep 17 00:00:00 2001 From: Jiya Gupta <141018273+Jiya873@users.noreply.github.com> Date: Tue, 16 Dec 2025 00:04:22 +0530 Subject: [PATCH] Fix: Make Prior __getattr__ safe for Sphinx introspection --- pymc_extras/prior.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pymc_extras/prior.py b/pymc_extras/prior.py index a4f5ffa44..d2385d518 100644 --- a/pymc_extras/prior.py +++ b/pymc_extras/prior.py @@ -1575,9 +1575,9 @@ def __getattr__(name: str): samples = dist.sample_prior(coords={"channel": ["C1", "C2", "C3"]}) """ - # Protect against doctest - if name == "__wrapped__": - return + # Ignore Python internal attributes needed for introspection + if name.startswith("__"): + raise AttributeError(name) _get_pymc_distribution(name) return partial(Prior, distribution=name)