Commit 7d8439e8 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.29.x'

parents 34816534 c6d4e57b
...@@ -144,6 +144,9 @@ Bugs fixed ...@@ -144,6 +144,9 @@ Bugs fixed
* Starred expressions in %-formatting tuples could fail to compile for * Starred expressions in %-formatting tuples could fail to compile for
unicode strings. (Github issue #2939) unicode strings. (Github issue #2939)
* Passing Python class references through ``cython.inline()`` was broken.
(Github issue #2936)
0.29.7 (2019-04-14) 0.29.7 (2019-04-14)
=================== ===================
......
...@@ -87,7 +87,7 @@ def safe_type(arg, context=None): ...@@ -87,7 +87,7 @@ def safe_type(arg, context=None):
elif 'numpy' in sys.modules and isinstance(arg, sys.modules['numpy'].ndarray): elif 'numpy' in sys.modules and isinstance(arg, sys.modules['numpy'].ndarray):
return 'numpy.ndarray[numpy.%s_t, ndim=%s]' % (arg.dtype.name, arg.ndim) return 'numpy.ndarray[numpy.%s_t, ndim=%s]' % (arg.dtype.name, arg.ndim)
else: else:
for base_type in py_type.mro(): for base_type in py_type.__mro__:
if base_type.__module__ in ('__builtin__', 'builtins'): if base_type.__module__ in ('__builtin__', 'builtins'):
return 'object' return 'object'
module = context.find_module(base_type.__module__, need_pxd=False) module = context.find_module(base_type.__module__, need_pxd=False)
......
...@@ -51,6 +51,12 @@ class TestInline(CythonTest): ...@@ -51,6 +51,12 @@ class TestInline(CythonTest):
foo = inline("def foo(x): return x * x", **self.test_kwds)['foo'] foo = inline("def foo(x): return x * x", **self.test_kwds)['foo']
self.assertEqual(foo(7), 49) self.assertEqual(foo(7), 49)
def test_class_ref(self):
class Type(object):
pass
tp = inline("Type")['Type']
self.assertEqual(tp, Type)
def test_pure(self): def test_pure(self):
import cython as cy import cython as cy
b = inline(""" b = inline("""
......
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