-
Notifications
You must be signed in to change notification settings - Fork 51
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
jaxtyping does not play nicely with inheritance #43
Comments
Right, this is because (It was only designed to work on functions.) We could probably extend it to classes in the following way: def jaxtyped(fn):
if inspect.isclass(fn):
init = jaxtyped(fn.__init__)
fn.__init__ = init
return fn
else:
... # existing implementation Give that a try and see if it works? If it does then I would be happy to accept the above as a PR. |
Yes, that works!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code below fails, whether I use typeguard or beartype,
and gives the error
However if I omit the initial
@jaxtyped
it works.@slinderman
The text was updated successfully, but these errors were encountered: