HI,
I've been using a type annotation of some sort as below which worked fine up to 0.29.36.
import cython
import inspect
class _Signal:
pass
def test_inline():
scope = cython.inline("""
def unit_interface(a : _Signal, q : _Signal):
return []
""", globals = test_inline.__globals__)
f = scope['unit_interface']
print(inspect.getfullargspec(f))
sig = inspect.signature(f)
ann = f.__annotations__
print('DEBUG ANNOTATIONS', ann)
assert issubclass(ann['a'], _Signal)
The reasons for using inline compilation is that code is being translated first, then compiled. When I write this code out to a .pyx and build an extension from it, all works fine.
The interesting thing is that the class type annotations are obviously seen as strings:
DEBUG ANNOTATIONS {'a': '_Signal', 'q': '_Signal'}
When the class definitions are added to the inline-compiled source string, the compiler seems to accept the definition, however my internal type check would choke on the string type annotation.
Is this a bug, or something I've been missing?