summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2020-07-10 11:40:29 +0200
committerStefan Behnel <stefan_ml@behnel.de>2020-07-10 11:40:29 +0200
commitc42ad91755f6c17e26e4d80d79926925bfb76731 (patch)
treefd2eea5403f31877162c021f35c9e8de4f10c242
parent0b4207a2d9b416bd38bfde1254426fdf5f2b671a (diff)
parent343262aed8b329c9105900df5f35a1a43eba8655 (diff)
downloadcython-c42ad91755f6c17e26e4d80d79926925bfb76731.tar.gz
Merge branch '0.29.x'
-rw-r--r--CHANGES.rst10
-rw-r--r--Cython/Compiler/Builtin.py2
-rw-r--r--tests/run/cython3.pyx8
3 files changed, 19 insertions, 1 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index c186c8970..cfd0bec44 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -456,6 +456,16 @@ Other changes
* Support for Python 2.6 was removed.
+0.29.22 (2020-??-??)
+====================
+
+Bugs fixed
+----------
+
+* ``repr()`` was assumed to return ``str`` instead of ``unicode`` with ``language_level=3``.
+ (Github issue #3736)
+
+
0.29.21 (2020-07-09)
====================
diff --git a/Cython/Compiler/Builtin.py b/Cython/Compiler/Builtin.py
index 0818ed34a..fe132c19d 100644
--- a/Cython/Compiler/Builtin.py
+++ b/Cython/Compiler/Builtin.py
@@ -205,7 +205,7 @@ builtin_function_table = [
#('raw_input', "", "", ""),
#('reduce', "", "", ""),
BuiltinFunction('reload', "O", "O", "PyImport_ReloadModule"),
- BuiltinFunction('repr', "O", "O", "PyObject_Repr", builtin_return_type='str'),
+ BuiltinFunction('repr', "O", "O", "PyObject_Repr"), # , builtin_return_type='str'), # add in Cython 3.1
#('round', "", "", ""),
BuiltinFunction('setattr', "OOO", "r", "PyObject_SetAttr"),
#('sum', "", "", ""),
diff --git a/tests/run/cython3.pyx b/tests/run/cython3.pyx
index 295658884..f0c18bcec 100644
--- a/tests/run/cython3.pyx
+++ b/tests/run/cython3.pyx
@@ -654,3 +654,11 @@ async def async_def_annotations(x: 'int') -> 'float':
u'int'
"""
return float(x)
+
+
+def repr_returns_str(x) -> str:
+ """
+ >>> repr_returns_str(123)
+ '123'
+ """
+ return repr(x)