Files
jaxtyping/test/test_decorator.py
T
Patrick Kidger 81c56052e5 Fixes for some new failures. (Where did they come from?) (#65)
* Fixes for some new failures. (Where did they come from?)

* Fixed isort?
2023-02-16 10:08:57 -08:00

27 lines
496 B
Python

import abc
from jaxtyping import jaxtyped
class M(metaclass=abc.ABCMeta):
@jaxtyped
@classmethod
def f(cls):
return 3
@jaxtyped
@abc.abstractmethod
def g(self):
...
# Check that the @jaxtyped decorator doesn't blat the __get__ of @classmethod
def test_classmethod():
assert M.f() == 3
# Check that the @jaxtyped decorator doesn't blat the __isabstractmethod__ of
# @abstractmethod
def test_abstractmethod():
assert M.g.__isabstractmethod__