numba jit:'DataFlowAnalysis' 对象没有属性 'op_STORE_DEREF'

numba jit: 'DataFlowAnalysis' object has no attribute 'op_STORE_DEREF'

我正在尝试 运行 使用 numba 执行以下代码但出现错误:

from numba import jit

@jit(nopython=True)
def create_card_deck():
    values = "23456789TJQKA"
    suites = "CDHS"
    Deck = []
    [Deck.append(x + y) for x in values for y in suites]
    return Deck

create_card_deck()

感谢任何导致此错误的建议:

'DataFlowAnalysis' object has no attribute 'op_STORE_DEREF'

这里有两个问题——更根本的一个是numba不支持nopython模式下的字符串

@jit(nopython=True)
def create_card_deck():
    values = "23456789TJQKA"
    suites = "CDHS"
    return values

In [4]: create_card_deck()
---------------------------------------------------------------------------
NotImplementedError : Failed at nopython (nopython mode backend)
cannot convert native str to Python object

该特定错误是因为 nopython 模式目前也不支持列表理解。

https://github.com/numba/numba/issues/504