Numba 嵌套函数不会执行(版本 0.47)

Numba nested function won't execute (version 0.47)

我很困惑为什么这不起作用,文档说:

2.6.1.2.3。内部函数和closure: Numba 现在支持内部函数,只要它们是非递归的并且只在本地调用,但不作为参数传递或作为结果返回。 closure 变量(定义在外部作用域中的变量)在 也支持内部函数。

import numba

@numba.jit(nopython=True, debug=False, parallel=False, cache=True)
def outer() -> int:

    @numba.jit(nopython=True, debug=False, parallel=False, cache=True)
    def inner() -> int:
        return 1

    return inner()

outer()

错误:

Failed in nopython mode pipeline (step: analyzing bytecode)
op_MAKE_FUNCTION with annotations is not implemented

我是不是在做什么傻事?

(os: Ubuntu 19.10)

Soln:不要使用类型声明并删除内部 j​​it 装饰器