Skip to content

Commit af91def

Browse files
committed
Type rv_op based on behaviour rather than type
This is a bit like using a Protocol class, we say that whatever is passed to rv_op, it should return a TensorVariable.
1 parent b2692ea commit af91def

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc/distributions/distribution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ def change_symbolic_rv_size(op: SymbolicRandomVariable, rv, new_size, expand) ->
423423
class Distribution(metaclass=DistributionMeta):
424424
"""Statistical distribution"""
425425

426-
rv_op: RandomVariable | SymbolicRandomVariable = None
427-
rv_type: MetaType = None
426+
rv_op: Callable[..., TensorVariable] | None = None
427+
rv_type: MetaType | None = None
428428

429429
def __new__(
430430
cls,

0 commit comments

Comments
 (0)