-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: typing issue due to __getattribute__
#775
Comments
Do you have a MWE? (For what it's worth I use generics successfully with Equinox elsewhere.) |
I'll try to make one.
Do you have jaxtyping + beartype on? |
Cheers! |
Hmm. It's challenging to reproduce the failure I'm seeing in GalacticDynamics/galax#377. The obvious minimal example doesn't raise the same error. from typing import Generic, TypeVar
import equinox as eqx
from beartype import beartype as typechecker
from jaxtyping import jaxtyped
from typeguard import typechecked as typechecker
T = TypeVar("T")
@jaxtyped(typechecker=typechecker)
class Parametric(eqx.Module, Generic[T]):
value: T
@jaxtyped(typechecker=typechecker)
def function(parametric: Parametric[T]) -> Parametric[T]:
return parametric |
Discovered in GalacticDynamics/galax#377, when
jaxtyping
's run-time type-checking is turned on,Module.__getattribute__
is not set up to allow for modules to be Generic.The traceback looks like:
I think
__parameters__
might need to be special-cased.The text was updated successfully, but these errors were encountered: