I am python beginner and have a question..
I have a class function looks like:
class Example(A):
def __init__(self, ID, name, products, itemlist):
A.__init__(self, itemID, name)
self.products = products
self.itemlist = itemlist
def get_items_list(self):
return self.itemlist
Assume I have written
Example('SomeID', 'Somename', products, [('a', 1), ('b', 1), ('c', 1)])
then when I do
get_items_list()
My code returns
bound method Compound.get_items_str of SomeID, Somename, <__main__.Products object at 0x102d2e4d0>>
instead of the item list I provided…
Any answers would be so appreciated and excuse for my mistakes.
it looks like you didn’t call the method like in this question.
check your code and see if there is a
instead of a