gpt4 book ai didi

python - 什么是 Python 中的 InstrumentedList?

转载 作者:太空狗 更新时间:2023-10-29 18:22:30 24 4
gpt4 key购买 nike

在一些 set 操作中,我在 Python 中遇到了这个错误:

TypeError: unhashable type: 'InstrumentedList'

什么是 Python 中的 InstrumentedList?我只找到了一些与 SQLAlchemy 相关的引用资料。这是列表的 SQLAlchemy 实现还是什么?

顺便说一下,它发生在做的时候:

set(self.some_list)

在哪里

print type(self.some_list) # <type 'list'>

最佳答案

是的,SQLAlchemy 使用它来实现一个类似列表的对象,它知道相关对象对对象的插入和删除(通过一对多和多对多关系)。

关于python - 什么是 Python 中的 InstrumentedList?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6654613/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com