title: Access class variable from function in Python
body: <p>I'm coding my first python game using OOP and I have some problems with the access to class variables.
  Specifically, I want to have access to a class variable from a method. For some variables it works, but for a specific boolean variable it does not work:</p>
  
  <pre><code>class Player(object):
      eaten = False
  
      def __init__(self):
            .....
  
  def eat(Player):
      Player.eaten = True
  </code></pre>
  
  <p>The problem is that, when the function is called, <i>eaten</i> does not override the variable in the class. For other variables it does correctly what I want though.</p>
  
  <p>EDIT:
  If, inside a method in the Class player, I add <code>print(self.eaten)</code> after <code>eat()</code> is called, it still prints always <code>False</code></p>
  
  <pre><code> class Player(object):
      eaten = False
  
      def move():
          print(self.eaten)
  
  def eat(Player):
      Player.eaten = True
  </code></pre>
  
  <p>Thank you!</p>