Skip to content

Commit 87cd36a

Browse files
committed
Fix: Make Prior __getattr__ safe for Sphinx introspection
1 parent 3531d29 commit 87cd36a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pymc_extras/prior.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,9 +1575,9 @@ def __getattr__(name: str):
15751575
samples = dist.sample_prior(coords={"channel": ["C1", "C2", "C3"]})
15761576
15771577
"""
1578-
# Protect against doctest
1579-
if name == "__wrapped__":
1580-
return
1578+
# Ignore Python internal attributes needed for introspection
1579+
if name.startswith("__"):
1580+
raise AttributeError(name)
15811581

15821582
_get_pymc_distribution(name)
15831583
return partial(Prior, distribution=name)

0 commit comments

Comments
 (0)