Commit 5e702a5e authored by Stefan Behnel's avatar Stefan Behnel

fix return type of repr(): CPython guarantees to return str

parent 046d77d9
......@@ -215,7 +215,7 @@ builtin_function_table = [
#('raw_input', "", "", ""),
#('reduce', "", "", ""),
BuiltinFunction('reload', "O", "O", "PyImport_ReloadModule"),
BuiltinFunction('repr', "O", "O", "PyObject_Repr", builtin_return_type='basestring'),
BuiltinFunction('repr', "O", "O", "PyObject_Repr", builtin_return_type='str'),
#('round', "", "", ""),
BuiltinFunction('setattr', "OOO", "r", "PyObject_SetAttr"),
#('sum', "", "", ""),
......
......@@ -2,6 +2,8 @@
cdef int f() except -1:
cdef object x, y = 0, z = 0, w = 0
cdef str sstring
cdef basestring sustring
cdef int i
x = abs(y)
delattr(x, 'spam')
......@@ -20,6 +22,8 @@ cdef int f() except -1:
x = pow(y, z)
x = reload(y)
x = repr(y)
sstring = repr(x)
sustring = repr(x)
setattr(x, y, z)
#i = typecheck(x, y)
#i = issubtype(x, y)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment