什么是Python中的InstrumentedList?

Auf*_*ind 11 python

在某些设置操作期间,我在Python中遇到此错误:

TypeError: unhashable type: 'InstrumentedList'
Run Code Online (Sandbox Code Playgroud)

什么是InstrumentedListPython?我只找到了一些与SQLAlchemy相关的引用.这是列表中的SQLAlchemy实现还是什么?

顺便说一下,它在执行时发生:

set(self.some_list)
Run Code Online (Sandbox Code Playgroud)

哪里

print type(self.some_list) # <type 'list'>
Run Code Online (Sandbox Code Playgroud)

Vin*_*jip 11

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