I'm doing a function that returns an object list. Code snippet:
def guarda_word(lista_palavras,lista_objeto,indice):
for i in lista_palavras:
if bool(lista_objeto) == True: # a list de objeto esta vazia
i = PalavraIndices(i)
i.add_item(indice,1)
lista_objeto.append(i)
elif i not in lista_objeto: # o elemento da lista de palavras ainda nao tem um objeto
i = PalavraIndices(i)
i.add_item(indice,1)
lista_objeto.append(i)
else:
i.add_item(indice,1)
return lista_objeto
lista_objeto = guarda_word(palavras_A,lista_objeto,'arquivoA')
print(lista_objeto)
The problem is, when I start this list of objects on the screen .. it goes like this:
[<__main__.PalavraIndices object at 0x005E6970>, <__main__.PalavraIndices
object at 0x005E6990>, <__main__.PalavraIndices object at 0x005E69B0>,
<__main__.PalavraIndices object at 0x005E69D0>, <__main__.PalavraIndices
object at 0x005E69F0>, <__main__.PalavraIndices object at 0x005E6A30>,
<__main__.PalavraIndices object at 0x005E6A50>, <__main__.PalavraIndices
object at 0x005E6A70>, <__main__.PalavraIndices object at 0x005E6A90>,
<__main__.PalavraIndices object at 0x005E6A10>, <__main__.PalavraIndices
object at 0x005E6AB0>, <__main__.PalavraIndices object at 0x005E6AD0>,
<__main__.PalavraIndices object at 0x005E6AF0>]
Does anyone know the proque is not just showing the name of each object in this list?