Skip to content

Commit

Permalink
Fixes for 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad committed Jan 9, 2025
1 parent 5ba7bb9 commit f90723a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dace/frontend/python/replacements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,11 +1565,11 @@ def _representative_num(dtype: Union[dtypes.typeclass, Number]) -> Number:
nptype = dtype.type
else:
nptype = dtype
if issubclass(nptype, bool):
if issubclass(type(nptype), bool):
return True
elif issubclass(nptype, np.bool_):
elif issubclass(type(nptype), np.bool_):
return np.bool_(True)
elif issubclass(nptype, Integral):
elif issubclass(type(nptype), Integral):
# NOTE: Returning the max representable integer seems a better choice
# than 1, however it was causing issues with some programs. This should
# be revisited in the future.
Expand Down
4 changes: 3 additions & 1 deletion tests/python_frontend/method_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Tests dace.program as class methods """
import pytest
import dace
import numpy as np
import sys
Expand Down Expand Up @@ -126,6 +127,7 @@ def test_static_withclass():
assert np.allclose(MyTestClass.static_withclass(A), A + 3)


@pytest.mark.skip(reason="Python 3.13 killed chained @classmethods, making this impossible for now")
def test_classmethod():
# Only available in Python 3.9+
if sys.version_info >= (3, 9):
Expand Down Expand Up @@ -282,7 +284,7 @@ def tester(a):
test_callable()
test_static()
test_static_withclass()
test_classmethod()
#test_classmethod()
test_nested_methods()
test_decorator()
test_sdfgattr_method_jit()
Expand Down

0 comments on commit f90723a

Please sign in to comment.