79788150

Date: 2025-10-11 17:43:00
Score: 1.5
Natty:
Report link

To follow up on @jakevdp's answer, a completely equivalent but perhaps slightly more elegant way of systematically pre-empting this issue in equinox is to assign a value directly in the attribute definition:

class MyClass(eqx.Module):

    ...

    param: float = 0 # set to a placeholder to allow tracing
    
    def __init__(self):
        self.param = self._integral_moment(3)

    ...
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @jakevdp's
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Ben