我正在尝试使用以下代码创建对象列表的最小堆,
import heapq
class my_obj:
def __init__(self, value_passed, other_value_passed):
self.value = value_passed
self.other_value = other_value_passed
my_list = [my_obj(34, 'data1'), my_obj(23, 'data2'), my_obj(30, 'data3')]
heapq.heapify(my_list.value) #this gives error, 'list' object has no attribute 'value'