[Tutor] Doing the same thing twice. Works first time but not the second.

eryksun eryksun at gmail.com
Thu Sep 6 10:36:59 CEST 2012


On Fri, Aug 17, 2012 at 4:11 PM, Matthew Love
<matthewlove94 at googlemail.com> wrote:
>     def inventory(self):
>         self.inventory = ["torch"]
>         return self.inventory

What is 'self.inventory' before you call inventory(), and what is it
afterwards? A quick fix would be to name the list "_inventory" and
return self._inventory.


More information about the Tutor mailing list