-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Different type hints will result in TypingError
when using overload
#9571
Labels
bug - typing
Bugs: occuring at typing time
Comments
I think type hints are used for jitclass members: #5609 |
I wonder why my PR didn't break the related tests for jitclass type annotation support. def test_type_annotations(self):
spec = [("x", int32)]
@jitclass(spec)
class Test1(object):
x: int
y: pt.List[float]
def __init__(self):
pass
self._check_spec(spec, Test1, spec + [("y", types.ListType(float64))])
def test_type_annotation_inheritance(self):
class Foo:
x: int
@jitclass
class Bar(Foo):
y: float
def __init__(self, value: float) -> None:
self.x = int(value)
self.y = value
self._check_spec(
test_cls=Bar, all_expected=[("x", typeof(0)), ("y", typeof(0.0))]
) I guess the typing for class fields didn't go through the part I changed in |
I'd bet that these are different things and the check that is it failing only applies to overloads. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
test code:
got
TypingError
:Somehow, numba regards type hints as parts of arguments, causing this error.
Perhaps before comparing arguments, shall we remove type hints first, given numba basically doesn't care type hints for now?
The text was updated successfully, but these errors were encountered: