title: instance has no attribute '__len__'
body: <p>this will be a simple question, so it won't take you much time to explain it to me, but it would help me (and possibly other people too) understand something about classes and methods and Python.</p>
  
  <p>My code wants to represent a board game, at this level just on a board with N holes in a row, which can accommodate marbles numbered from 0 to N-1 (in a random order).</p>
  
  <pre><code>class MarblesBoard:
      '''define the board game'''
      def __init__(self, Board):
          self._Board = Board
          self._n = len(Board)
  
      '''first type of move available: switch the first two marbles'''
      def switch(Board):
          Board[0], Board[1] = Board[1], Board[0]
          return Board
  
      '''second type of move available: move all the marbles by 1 space to the left'''
      def rotate():
          temp = Board[0]
          for i in range (0, n-1):
              Board[i] = Board[i+1]
          Board[n-1] = temp
          return Board
  
      '''print the state'''
      def __repr__(Board):
          for i in range(0, len(Board)):
              print self[i],
  
      '''rest to be developed when this works'''
  </code></pre>
  
  <p>now, I test displaying the board and moving the marbles. So I let</p>
  
  <pre><code>First = MarblesBoard([1,2,3,4])
  First.rotate
  </code></pre>
  
  <p>and only get </p>
  
  <pre><code>&lt;repr(&lt;instancemethod at 0x104230410&gt;) failed: AttributeError: MarblesBoard instance has no attribute '__len__'&gt;
  </code></pre>
  
  <p>I know there has already been a similar question about this error message. 
  <a href="https://stackoverflow.com/questions/16389356/attributeerror-entry-instance-has-no-attribute-len">AttributeError: Entry instance has no attribute &#39;__len__&#39;</a></p>
  
  <p>I still somehow don't see how does the same error arise in my code. Would you mind explaining (in general) when is the attribute "<strong>len</strong>" established, and maybe suggest how could it be done in this code?</p>