summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2023-02-25 11:57:38 +0100
committerStefan Behnel <stefan_ml@behnel.de>2023-02-25 11:57:38 +0100
commite92a9c8e0f81ca8ac4eef45d635bb8412911c13b (patch)
treef07b92ba3c133826787de86fe10544897793eaa2
parent8db63cf0944998819fb70d9639d53ff777ec8ac1 (diff)
downloadcython-e92a9c8e0f81ca8ac4eef45d635bb8412911c13b.tar.gz
Make test pass after adding float inference in GH-5234. We should really be inferring either Python float or C double from the Python type annotation of 'x' instead, but as it stands, we infer the types from the ctuple assignment.
-rw-r--r--tests/run/pep526_variable_annotations.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/run/pep526_variable_annotations.py b/tests/run/pep526_variable_annotations.py
index d5245bcde..97e640de6 100644
--- a/tests/run/pep526_variable_annotations.py
+++ b/tests/run/pep526_variable_annotations.py
@@ -232,7 +232,7 @@ def test_tuple_without_typing(a: tuple[cython.int, cython.float], b: tuple[cytho
>>> test_tuple_without_typing((1, 1.0), (1, 1.0), (1, 1.0))
int
int
- Python object
+ float
Python object
(int, float)
tuple object
@@ -248,7 +248,7 @@ def test_tuple_without_typing(a: tuple[cython.int, cython.float], b: tuple[cytho
print(cython.typeof(z))
print("int" if cython.compiled and cython.typeof(x[0]) == "Python object" else cython.typeof(x[0])) # FIXME: infer Python int
- print(cython.typeof(p) if cython.compiled or cython.typeof(p) != 'float' else "Python object") # FIXME: infer C double
+ print(cython.typeof(p) if cython.compiled or cython.typeof(p) != 'float' else "float") # FIXME: infer C double (or float *object*) from Python type annotation
print(cython.typeof(x[1]) if cython.compiled or cython.typeof(p) != 'float' else "Python object") # FIXME: infer C double
print(cython.typeof(a) if cython.compiled or cython.typeof(a) != 'tuple' else "(int, float)")
print(cython.typeof(x) + (" object" if not cython.compiled else ""))