Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
现在我有一段这样的代码:
[{'id': i, 'title': somedict[i]['title'] % db.somecollection.find(somedict[i]['query']).count()} for i in somedict.keys()]
它有效,但是,我不喜欢我不关闭由find(...). 有没有办法修改这段代码,让它调用close(),保持内联?
find(...)
close()