On 17/08/12 21:11, Matthew Love wrote:
class Player(object):
def inventory(self):
self.inventory = ["torch"]
return self.inventory
Notice that you override the name inventory.
Initially self.inventory is the inventory() method.
But then you change self.inventory to be a list.
So the next time you call player.inventory() you are
trying to execute the list hence the error.
You need to change the name of the inventory attribute
to something like theInventory...
HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor