[Tutor] Doing the same thing twice. Works first time but not the second.
Omar Abou Mrad
omar.aboumrad at gmail.com
Thu Sep 6 11:28:17 CEST 2012
On Fri, Aug 17, 2012 at 11:11 PM, Matthew Love <matthewlove94 at googlemail.com
> wrote:
>
> This is the error:
>
> Traceback (most recent call last):
> File "C:\Users\Matthew\Desktop\test.py", line 16, in <module>
> print(player.inventory())
> TypeError: 'list' object is not callable
>
>
The python debugger can also give you a hint of how player.inventory
changed:
misc $ pdb test.py
-> class Player(object):
(Pdb) n
-> player = Player()
(Pdb) n
Player created.
-> player.inventory()
(Pdb) whatis player.inventory
*Function inventory*
(Pdb) n
-> player.inventory()
(Pdb) whatis player.inventory
*<type 'list'>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120906/b54fa066/attachment-0001.html>
More information about the Tutor
mailing list