如何用另一个 class 引用一个 Class 列表?

How to reference a Class List with another class?

我正在设置一个脚本,它将从列表中的 excel 和 return 中提取数据。现在我正试图将数据重组为具有共同属性的较小列表。 (例如:一个包含行索引的列表,'Pencil')我一直有较小的列表 returning None.

我已经检查过,提取数据的列表工作正常。但我似乎无法让较小的列表工作。

#Create a class for the multiple lists of Columns
class Data_Column(list):
     def Fill_List (self,col): #fills the list
         for i in range(sheet.nrows):
             self.append(sheet.cell_value(i,col))
#Create a class for a specific list that has data of a common artifact
class Specific_List(list):
     def Find_And_Fill (self, listy, word):
         for i in range (sheet.nrows):
             if listy[i] == word:
                 self.append(I)
#Initiate and Populate lists from excel spreadsheet
date = Data_Column()
date.Fill_List(0)

location = Data_Column()
location.Fill_List(1)

name = Data_Column()
name.Fill_List(2)

item = Data_Column()
item.Fill_List(3)

specPencil = Specific_List()
print(specPencil.Find_And_Fill(item,'Pencil'))

我希望有一个列表,其中包含找到 'Pencil' 的索引,例如 [1,6,12,14,19]。 实际输出是:None

我需要打印最后一行。

specPencil.Find_And_Fill(item,'Pencil')
print(specPencil)

我知道这是一个简单的修复